Skip to content

arched-dev/jsonomy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copy code

Jsonomy

Jsonomy is a basic JSON parser that converts API's JSON output to be more Pythonic. It includes functionalities like converting camel case to snake case, and timestamps to datetime objects.

Features

  • Convert JSON keys from camel case to snake case.
  • Identify strings that represent dates and convert them to datetime objects.
  • Recursively process JSON data structures.

Installation

To install Jsonomy, you can use pip:

pip install jsonomy

Usage

from jsonomy import Jsonomy

data = {
    "createdAt": "2022-07-01T10:00:00Z",
    "someNestedData": {
        "moreDetails": "data"
    },
    "aList": ["item1", "item2"]
}

# load data into Jsonomy and process
formatter = Jsonomy(data)
processed = formatter.format()

# print the processed data 
formatter.pprint()

# reload new data
formatter.load(data)

#load and format
Jsonomy(data).format()

#load and pretty print to a string
pretty_json = Jsonomy(data).pprint(as_str=True)

License

This project is licensed under the terms of the MIT license.

Contact

For questions, feel free to reach out to Lewis Morris at hello@arched.dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages