Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsonchick-0.0.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

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

Hashes for jsonchick-0.0.2.tar.gz
Algorithm Hash digest
SHA256 27d7ad1655575d3608fcaedcee157338a12bfc87ca8253ecd08df1d53828ca65
MD5 a78a655bd7effe15653be81b6d27077e
BLAKE2b-256 8987fa79c1cd4d8398c54b1a4d9762da9efcde2c7c452f9c5aa4be83ac6f92c9

See more details on using hashes here.

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

Hashes for jsonchick-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 97f662beb7f240434add650d3b0eabc55825b61d6c67da45e49b56c36855f3d7
MD5 b121d373faaeb45be65c9aa14a49ee4d
BLAKE2b-256 0eea1dec75e595316d4c3ac42de440a0a6678800458f8ced1e19bab4293c190c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page