A JSON helper for Python
Project description
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.6 >
License
This project is licensed under MIT - see the [LICENSE](LICENSE.txt) file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jthon-1.0.6.tar.gz
(4.4 kB
view details)
Built Distribution
jthon-1.0.6-py3-none-any.whl
(5.2 kB
view details)
File details
Details for the file jthon-1.0.6.tar.gz
.
File metadata
- Download URL: jthon-1.0.6.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.2 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9f86861f34cbe1b96d70b3ae5554d2742a44ad7ce2bc12a003651b5aa0ff3b5 |
|
MD5 | 86bbc4ca3becebdd484de6ffe0b45f15 |
|
BLAKE2b-256 | cabfdd607c699f4371b67e59ff97216089a92fa78f0a5329964accd48685e1a6 |
File details
Details for the file jthon-1.0.6-py3-none-any.whl
.
File metadata
- Download URL: jthon-1.0.6-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.2 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13413cd39c68f52ac0a6ce9befd4ad3a33c0d7227a0fb12519e262db80103258 |
|
MD5 | cc4ce5a8d8fb264212f5f1db62f43d46 |
|
BLAKE2b-256 | 05aacfd8b182c9b21ce82bf0bcccf08d02e36df100b458ac7d3c97953493b957 |