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.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 jsonpath-rfc9535 2.0.0
File Size Uploaded
jsonpath_rfc9535-2.0.0.tar.gz 146.1 kB Details

Built distribution (wheel)

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

Total release size: 178.5 kB

Release files / jsonpath_rfc9535-2.0.0.tar.gz

Download URL jsonpath_rfc9535-2.0.0.tar.gz
Size 146.1 kB
Tags Source
SHA-256 checksum
How to use checksums
42eb669ba7c270723011306c07ee5620fd4f6def42e22c22710778a3b4dc4e35
BLAKE2b-256 checksum
How to use checksums
9b1e77a5b855f63c52e5e295a55bc4592bf7cf36186ae009587ec80fa743e417
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.0-py3-none-any.whl

Download URL jsonpath_rfc9535-2.0.0-py3-none-any.whl
Size 32.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
245ff25d8e8d134a969a37d207369371fdba96d8968316a1dfe0f4806b0af63b
BLAKE2b-256 checksum
How to use checksums
c01cfb696ba39c62e566641b84be05104b2ee68a063f70d15ab621864b87acff
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

2.0.1

2 release files

This release

2.0.0 This release

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