skillfed

jsonpath-rw

A robust and significantly extended implementation of JSONPath for Python, with a clear AST for metaprogramming.

jsonpath-rw v1.4.0 4.1M downloads/30d#2,375 on PyPI610
Permissive license Apache 2.0 Abandoned released

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-rw

uv

uv add jsonpath-rw

poetry

poetry add jsonpath-rw

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3

Tags

jsonpath query languagejson path extractionxpath for jsonjson data navigationjsonpath parserjson tree traversaljson query expressions
json-queryingunmaintained

More Text Processing packages