Skip to main content

JSON(python dict) finder

Install

  • pip install jsonfind

CLI

# jsonfind
Usage: jsonfind [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  find-by
  find-eq
  find-is
  find-key
  find-subset

# jsonfind find-eq --help
Usage: jsonfind find-eq [OPTIONS] [OBJ]

Options:
  --verbose / --no-verbose
  --target TEXT                   query(JSON string)  [required]
  --format [jsonpath|jsonpointer]
  --help                          Show this message and exit.
  • jo hello=world a=$(jo b=$(jo c=d))
    • {"hello":"world","a":{"b":{"c":"d"}}}
  • jo hello=world a=$(jo b=$(jo c=d)) | jsonfind find-eq --target $(jo c=d) --format jsonpointer
    • ["/a/b"]
  • jo hello=world a=$(jo b=$(jo c=d)) | ./bin/jsonfind find-eq --target $(jo c=d) --format jsonpath
    • ["a.b"]
  • jo hello=world a=$(jo b=$(jo c=d)) | ./bin/jsonfind find-by --format jsonpointer --query /a/b
    • {"c": "d"}
  • jo hello=world a=$(jo b=$(jo c=d)) | ./bin/jsonfind find-by --format jsonpath --query a.b
    • [{"c": "d"}]

Python

>>> from jsonfind import JsonFind
>>> obj = {"a":"b","c":{"d":"e"}}
>>> tgt = obj["c"]
>>> JsonFind.to_jsonpointer(JsonFind.find_eq(obj, tgt))
'/c'
>>> JsonFind.to_jsonpath(JsonFind.find_eq(obj, tgt))
'c'

links

Metadata

Release files for jsonfind 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for jsonfind 0.1.1
File Interpreter ABI Platform
jsonfind-0.1.1-py3-none-any.whl Python 3 none any Details

Release files / jsonfind-0.1.1-py3-none-any.whl

Download URL jsonfind-0.1.1-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79198773ba5f96541f041ac11bf129b5c597f4b4326f3da3fb6d6ef85788dd8e
BLAKE2b-256 checksum
How to use checksums
a2563e9e8fcb2c7886c43f602991d68caf0e075c407966975668ab5bde3fed11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.8.0

Release history Release notifications | RSS feed

0.1.2

1 release file

This release

0.1.1 This release

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page