JSONWAY
Jsonway is the one stop to manage the JSON using the python . All the operations can be done using the JSONway .
Installation
pip install jsonway
Usage
Sample JSON
{
"store": {
"book": [
{
"category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95
},
{
"category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
"price": 12.99
}
],
"bicycle": {
"color": "red",
"price": 19.95
}
},
"expensive": 10
}
Lets say , we have to find the nested key author in the above JSON
import json
from jsonway.mainjsonway import *
with open('sample.json') as json_file:
data = json.load(json_file)
print(list(findkey('author', data, [])))
# output :[['store', 'book', 0, 'author'], ['store', 'book', 1, 'author'], ['store', 'book', 2, 'author'], ['store', 'book', 3, 'author']]
if you want to find the key and value then
print(list(findkeyvalue("title", data, [], "Sayings of the Century")))
if you want to find value then
print(list(findvalue("Sayings of the Century", data, [])))
if you want to get the value from a path then the path must be in the list form
getFromDict(data, ['store', 'book', 0, 'author'])
if you want to set the value at a particular key then
setInDict(dataDict, mapList, value)
to find all the keys values then
print(list(findallvalues('title', data)))
output : ['Sayings of the Century', 'Sword of Honour', 'Moby Dick', 'The Lord of the Rings']
Metadata
Release files for jsonway 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jsonway-1.0.2.tar.gz | 2.3 kB | Without provenance | Details for jsonway-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jsonway-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for jsonway-1.0.2-py3-none-any.whl |
Total release size: 6.2 kB
Release files / jsonway-1.0.2.tar.gz
| Download URL | jsonway-1.0.2.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a9ae0472c4c7a872e9627e3c39a95e8b1e736aa501ca91b7f587d1e83172a646
|
|
BLAKE2b-256 checksum How to use checksums |
bd30ad2f98e659dcbc46eb1335b92bc1eeb3a77becd1c548ed31ea460924141d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Release files / jsonway-1.0.2-py3-none-any.whl
| Download URL | jsonway-1.0.2-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a14921aa4e1aff7e1e20fe7d65971915597f9e31e8ed49ed2d7999d766cf6b1
|
|
BLAKE2b-256 checksum How to use checksums |
30f9a5e8c6126892e82570419d46daea99690eeadc30ed05cf770c75fa3d44dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Security for jsonway 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.