Skip to main content

JSON Hyperscan

A small, fast library that builds a simple "hyperscan" automaton to match many JSONPath (RFC9535-style) expressions against JSON documents. The project provides a compact in-process matcher that aims for parity with jsonpath_rfc9535.

Key features

  • Add many JSONPath selectors and build a matching automaton
  • Query JSON documents for matches efficiently
  • Support for field, child, descendant, index, slice and filter selectors
  • Small, well-tested core implementation located at src/json_hyperscan/json_hyperscan.py

Quick start

Install (developer/test environment)

This project uses modern Python tooling. Create a virtual environment and install dev dependencies listed in pyproject.toml.

python -m venv .venv
source .venv/bin/activate
pip install -U pip

# Recommended (fast, reproducible): install uv and use it to manage deps
pip install uv
# Create a venv and install project + dev deps using uv's pip frontend
uv pip install -e .[dev]

Note about the compliance test-suite

The project includes the JSONPath compliance tests as a git submodule at tests/jsonpath-compliance-test-suite. CI checks out submodules automatically, but if you're running tests locally you may need to initialize it first:

git submodule update --init --recursive

Or, if you only need runtime installation (no dev extras):

pip install -e .

Basic usage

A minimal example using the public API in JSONHyperscan:

from json_hyperscan import JSONHyperscan

hs = JSONHyperscan()
hs.add_pattern('$.store.book[*].author')
hs.add_pattern('$..title')

doc = {
	"store": {
		"book": [
			{"author": "Nigel Rees", "title": "Sayings of the Century"},
			{"author": "Evelyn Waugh", "title": "Sword of Honour"}
		]
	}
}

matches = list(hs.iter_matches(doc))
for m in matches:
	print(m)

License

See the LICENSE file in the repository.

Acknowledgements

This project uses jsonpath_rfc9535 for parsing and some tests compare output to other JSONPath implementations. See pyproject.toml for the dependency list used in development and testing.

Metadata

Release files for json-hyperscan 0.1.0

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

Source distribution (sdist)

Source distribution for json-hyperscan 0.1.0
File Size Uploaded
json_hyperscan-0.1.0.tar.gz 70.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for json-hyperscan 0.1.0
File Interpreter ABI Platform
json_hyperscan-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 76.5 kB

Release files / json_hyperscan-0.1.0.tar.gz

Download URL json_hyperscan-0.1.0.tar.gz
Size 70.9 kB
Tags Source
SHA-256 checksum
How to use checksums
06f17155d31f9b0c4430c7082d60d6550d18aa62b83b7ef96cbeced28ec41b20
BLAKE2b-256 checksum
How to use checksums
56088358cf0e54e59b2ff082c6be874bf7d8b5f6a1a5beda032b8e180b1e844b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2025.

Transparency log

Release files / json_hyperscan-0.1.0-py3-none-any.whl

Download URL json_hyperscan-0.1.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
742c4d9604dd6138d2f02b7841cc0a5be5af0f9966e10a7ba798876083471aef
BLAKE2b-256 checksum
How to use checksums
51a27566818f176d18d1cf59b2cc7810570c14bc9b0c332364a343b0f4eec0e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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