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
Metadata
Release files for jthon 1.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jthon-1.0.6.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jthon-1.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.6 kB
Release files / jthon-1.0.6.tar.gz
| Download URL | jthon-1.0.6.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9f86861f34cbe1b96d70b3ae5554d2742a44ad7ce2bc12a003651b5aa0ff3b5
|
|
BLAKE2b-256 checksum How to use checksums |
cabfdd607c699f4371b67e59ff97216089a92fa78f0a5329964accd48685e1a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.11.2 Windows/10
|
Release files / jthon-1.0.6-py3-none-any.whl
| Download URL | jthon-1.0.6-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
13413cd39c68f52ac0a6ce9befd4ad3a33c0d7227a0fb12519e262db80103258
|
|
BLAKE2b-256 checksum How to use checksums |
05aacfd8b182c9b21ce82bf0bcccf08d02e36df100b458ac7d3c97953493b957
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.11.2 Windows/10
|