Python JSONPath
A flexible RFC 9535 JSONPath engine for Python with JSON Pointer and JSON Patch.
Repository Health
Technical Analysis
Python JSONPath is a flexible JSONPath engine for Python that also implements JSON Pointer (RFC 6901) and JSON Patch (RFC 6902). Its JSONPath support follows RFC 9535 and is validated against the JSONPath Compliance Test Suite, while offering configurable extensions for teams that need non-standard selectors. The library exposes a clean API for compiling and evaluating queries, iterating matches lazily, and applying pointer and patch operations to JSON-like data structures.
What You Get
- An RFC 9535-compliant JSONPath query engine
- JSON Pointer (RFC 6901) resolution for addressing single values
- JSON Patch (RFC 6902) support for applying structured edits
- Lazy iteration over matches for large documents
- Configurable environments for enabling non-standard selectors
Common Use Cases
- Extracting values from large or deeply nested JSON API responses
- Addressing and updating specific nodes in configuration documents
- Applying JSON Patch changesets to stored JSON records
Under The Hood
Architecture - Expressions are parsed into reusable query objects that walk Python dict/list structures lazily, yielding matches on demand. The engine is organised around a configurable environment that governs which selectors and extensions are enabled, and separate modules implement JSON Pointer resolution and JSON Patch application alongside JSONPath.
Tech Stack - Pure Python (>=3.8, CPython and PyPy) with a hatchling build and zero required runtime dependencies; optional strict-mode extras add regex support. Documentation is built with mkdocs.
Code Quality - The project tests against the JSONPath Compliance Test Suite and carries its own extensive tests (tests/test_ietf.py, regex cache tests and more), reflecting a standards-focused, well-covered implementation marked Production/Stable.
API Design - The API is clean and layered: top-level helpers for one-shot queries, compiled objects for reuse, and clearly separated pointer/patch entry points. RFC alignment makes behaviour predictable for anyone familiar with the standards.