Skip to main content

A JSON helper for Python

Project description

Jthon

JSON, but with a lisp. This is a utility to make working with JSON files easier.

Installation

pip install jthon

Usage

import jthon
a_new_dict = {
    'fruits': {
        'pineapple':0,
        'apples': 2,
        'orange': 4,
        'pears': 1
    }
}
example = jthon.load('fruits', a_new_dict)
find = example.find(key='apple', exact=False)
for found in find:
    print("I've found '{}', with a value of '{}'.".format(found.key, found.value))
    print("{}".format(found.siblings))

print("There are {} oranges in the dict!".format(example.get('fruits').get('orange')))
example['fruits']['peach'] = 1
example.save()
print(example)

More examples can be found in the examples folder

Requirements

python3 >

Authors

License

This project is licensed under MIT - see the LICENSE file for details

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
jthon-1.0.2-py3-none-any.whl (5.3 kB) Copy SHA256 hash SHA256 Wheel py3
jthon-1.0.2.tar.gz (20.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page