jsonpath-rw
A robust and significantly extended implementation of JSONPath for Python, with a clear AST for metaprogramming.
What it is and what it does
jsonpath-rw is a full language implementation of JSONPath for Python, treating expressions as first-class objects that can be parsed, analyzed, transformed, and executed. Unlike regex-based alternatives, it provides a robust parser that enables powerful extensions and metaprogramming. The library extracts values from JSON structures using path expressions like `foo[*].baz`, and returns match objects that retain full path information and context, allowing you to reconstruct where each matched value came from in the original document.
The package supports an extended JSONPath syntax including operators like `where`, `|` (union), and `..` (recursive descent), plus named operators like `parent`. You can parse expressions from strings or build them programmatically using classes like `Fields`, `Slice`, and `Index`. It also offers automatic ID generation for data fragments that lack explicit identifiers, assigning them unique JSONPath-based IDs instead.
Use it for:
- Extract specific fields from deeply nested JSON API responses without manual dictionary traversal
- Build data transformation pipelines that query JSON documents using path expressions and preserve full context
- Programmatically generate JSONPath expressions in code for dynamic JSON querying without string parsing
- Implement automatic ID assignment for JSON data fragments to enable tracking and referencing
- Analyze JSON document structure and generate reports on matched paths and their locations
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses and executes JSONPath expressions against JSON data, returning matched values and their full paths within the document structure.
No, not for new projects. While the library is functionally complete and permissively licensed, it has been abandoned since 2015 with no maintenance for over a decade. The classifiers claim support only up to Python 3.3, and there is no evidence of compatibility with modern Python versions. High install friction combined with zero maintenance makes this a poor choice when maintained alternatives exist.
Install
jsonpath-rw on PyPI
pip
pip install jsonpath-rwuv
uv add jsonpath-rwpoetry
poetry add jsonpath-rwInstalling jsonpath-rw
Before you install
High install friction due to source distribution. Package is abandoned as of 2015 with no updates in over a decade; maintenance status is a significant concern for new projects.
License in practice
Licensed under Apache 2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install jsonpath-rw
from jsonpath_rw import parse
jsonpath_expr = parse('foo[*].baz')
matches = jsonpath_expr.find({'foo': [{'baz': 1}, {'baz': 2}]})
values = [match.value for match in matches]
PLY (the underlying parsing toolkit) does not work with docstrings removed; PYTHONOPTIMIZE=2 and python -OO will cause failures.
Verify before relying
- Whether the library works reliably with Python versions beyond 3.3 despite classifiers claiming only up to 3.3
- Current compatibility with modern Python versions and whether the PLY docstring requirement remains an issue
- Whether the segfault reported with PyPy has been resolved or remains a blocker
Package facts
| License | Apache 2.0 (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 4,135 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,130,391/month — #2,375 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jsonpath-rw-1.4.0.tar.gz
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
jsonpath-ngParse, query, and modify JSON structures using…
permissive · top 1,000 on PyPI
jsonpath-rw-extExtends JSONPath RW with additional query…
permissive · top 5,000 on PyPI
jsonpath-pythonExtracts, filters, sorts, and updates values in…
permissive · top 1,000 on PyPI
bc-jsonpath-ngParses and queries JSON structures using…
permissive · top 5,000 on PyPI
jsonpathImplements JSONPath, a query language for…
permissive · top 5,000 on PyPI
jsonpath-rfc9535Queries JSON data using RFC 9535 JSONPath…
permissive · top 15,000 on PyPI
python-jsonpathImplements RFC 9535-compliant JSONPath query…
permissive · top 5,000 on PyPI
objectpathObjectPath is a query language for finding and…
permissive · top 15,000 on PyPI
robotframework-jsonlibraryA Robot Framework library for querying, adding,…
permissive · top 15,000 on PyPI
httsleephttsleep polls HTTP endpoints repeatedly until…
permissive · top 15,000 on PyPI