Skip to main content

Inspect json data and fuzzy search for values or key names

Project description

Fuzzy matching for JSON payload. Find json_path that matches best for your provided value

Examples:

{
  "id": 11,
  "title": "perfume Oil",
  "description": "Mega Discount, Impression of A...",
  "price": 13,
  "discountPercentage": 8.4,
  "rating": 4.26,
  "stock": 65,
  "brand": "Impression of Acqua Di Gio",
  "category": "fragrances",
  "thumbnail": "https://i.dummyjson.com/data/products/11/thumbnail.jpg",
  "images": [
    "https://i.dummyjson.com/data/products/11/1.jpg",
    "https://i.dummyjson.com/data/products/11/2.jpg",
    "https://i.dummyjson.com/data/products/11/3.jpg",
    "https://i.dummyjson.com/data/products/11/thumbnail.jpg"
  ]
}
from jsfuzz import inspector

result = inspector.search(payload, "brand")
result.reverse()

pprint(result)
====================

Returns:

[('$.brand', 'Impression of Acqua Di Gio', 75.80645161290323),
 ('$.rating', '4.26', 38.18181818181817),
 ('$.category', 'fragrances', 22.769230769230766),
 ('$.thumbnail',
  'https://i.dummyjson.com/data/products/11/thumbnail.jpg',
  22.033898305084744),
 ('$.description', 'Mega Discount, Impression of A...', 20.657894736842106)]
result = inspector.search(payload, "65")
result.reverse()

pprint(result)
====================

Returns:

[('$.stock', '65', 30.0),
 ('$.rating', '4.26', 10.0),
 ('$.discountPercentage', '8.4', 0.0),
 ('$.price', '13', 0.0),
 ('$.description', 'Mega Discount, Impression of A...', 0.0)]

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

jsfuzz-0.1.0.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.

jsfuzz-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file jsfuzz-0.1.0.tar.gz.

File metadata

  • Download URL: jsfuzz-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for jsfuzz-0.1.0.tar.gz
Algorithm Hash digest
SHA256 593abd2aaf2955e632228c9c7ef2fb34d9a84d3bde7aaec2e781dcf2dab06c76
MD5 fbcc74684ad3453fd96628630ca6fc33
BLAKE2b-256 66d1b69166727796a694f9081d801b5173959eb884743aa84dbfc790acd7e8fd

See more details on using hashes here.

File details

Details for the file jsfuzz-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: jsfuzz-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for jsfuzz-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39c4191180c51fb1e3e18c27b55c89ee1dc807dbda5aac63b26336bd4fbe9667
MD5 132bda1f15403628accdeaaf325358d7
BLAKE2b-256 322d8be30ee69b84fb3f52aaea720d31cc42392a1e87accf381cc9292884fa39

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