Find JSON data paths by value
Project description
JSONCHICK
Get paths to a value in JSON data.
Install
pip install jsonchick
Use
from jsonchick import jsonchick
data = [{'k1': 'v1'}, [{'k2': ['v1']}]]
value = 'v1'
assert ((0, 'k1'), (1, 0, 'k2', 0)) == jsonchick.get_tuples(value, data)
assert [[0, 'k1'], [1, 0, 'k2', 0]] == jsonchick.get_lists(value, data)
assert ['[0]["k1"]', '[1][0]["k2"][0]'] == jsonchick.get_strings(value, data)
Credits
The lib is a modified version of a Stackoverflow answer on the question: https://stackoverflow.com/questions/31010299/json-get-key-path-in-nested-dictionary
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
jsonchick-0.0.2.tar.gz
(2.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jsonchick-0.0.2.tar.gz.
File metadata
- Download URL: jsonchick-0.0.2.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27d7ad1655575d3608fcaedcee157338a12bfc87ca8253ecd08df1d53828ca65
|
|
| MD5 |
a78a655bd7effe15653be81b6d27077e
|
|
| BLAKE2b-256 |
8987fa79c1cd4d8398c54b1a4d9762da9efcde2c7c452f9c5aa4be83ac6f92c9
|
File details
Details for the file jsonchick-0.0.2-py3-none-any.whl.
File metadata
- Download URL: jsonchick-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97f662beb7f240434add650d3b0eabc55825b61d6c67da45e49b56c36855f3d7
|
|
| MD5 |
b121d373faaeb45be65c9aa14a49ee4d
|
|
| BLAKE2b-256 |
0eea1dec75e595316d4c3ac42de440a0a6678800458f8ced1e19bab4293c190c
|