Skip to main content

RFC 9535 JSONPath: Query Expressions for JSON in Python

We follow RFC 9535 strictly and test against the JSONPath Compliance Test Suite.

License Tests
PyPi - Version Python versions


Table of Contents

Install

Install Python JSONPath RFC 9535 using pip:

python -m pip install jsonpath-rfc9535

Or uv:

uv add jsonpath-rfc9535

Or Pipenv:

pipenv install -u jsonpath-rfc9535

Example

import jsonpath_rfc9535 as jsonpath

expr = "$.users[?@.status == 'pending'].name"

data: dict[str, object] = {
    "users": [
        {"id": "usr_101", "name": "Alice", "status": "pending"},
        {"id": "usr_102", "name": "Bob", "status": "active"},
        {"id": "usr_103", "name": "Charlie", "status": "pending"},
    ],
}

nodes = jsonpath.find(expr, data)

print(nodes.values())  # ['Alice', 'Charlie']
print(nodes.locations())  # [('users', 0, 'name'), ('users', 2, 'name')]
print(nodes.paths())  # ["$['users'][0]['name']", "$['users'][2]['name']"]
  • Python JSONPath - Another Python package implementing JSONPath, but with additional features and customization options.
  • JSON P3 - RFC 9535 implemented in TypeScript.

License

python-jsonpath-rfc9535 is distributed under the terms of the MIT license.

Metadata

Release files for jsonpath-rfc9535 2.0.1

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

Source distribution (sdist)

Source distribution for jsonpath-rfc9535 2.0.1
File Size Uploaded
jsonpath_rfc9535-2.0.1.tar.gz 146.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jsonpath-rfc9535 2.0.1
File Interpreter ABI Platform
jsonpath_rfc9535-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 179.0 kB

Release files / jsonpath_rfc9535-2.0.1.tar.gz

Download URL jsonpath_rfc9535-2.0.1.tar.gz
Size 146.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cf6d0c5c9eea07bd3b9bca98ab7f8a461fafe06e3cde5aafc7a7621afeb24bc7
BLAKE2b-256 checksum
How to use checksums
10fdc4f328f7f224cc8a152269af233f602b3cca14a987d04690b29859fa1cf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / jsonpath_rfc9535-2.0.1-py3-none-any.whl

Download URL jsonpath_rfc9535-2.0.1-py3-none-any.whl
Size 32.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe00a8bf7d6f1091213f0dff33569acd1c7dddc54d57845941c74923598bd1b9
BLAKE2b-256 checksum
How to use checksums
56591ccb3174e4a09be353783928a19a23cbfabc5a835065ed4c21108b54ec44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

2.0.2

2 release files

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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