Skip to main content

Basic JSON parser, that converts APIs JSON output to be more pythonic, including camel case to snake case conversion, and converting timestamps to datetime objects.

Project description

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 lewis.morris@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

jsonomy-0.0.3-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file jsonomy-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: jsonomy-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for jsonomy-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a4eafde60e1605ea1af04ffd58a90df228a946e01a4327379e8122323071629e
MD5 1d4f40250e19b0df68025b5df13a0343
BLAKE2b-256 98b29b70439b9d99f7d0160e8dbaa80d88d22b628637c4db0c4fd2371b940f7b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page