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.2

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.2
File Size Uploaded
jsonpath_rfc9535-2.0.2.tar.gz 146.8 kB Details

Built distribution (wheel)

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

Total release size: 179.1 kB

Release files / jsonpath_rfc9535-2.0.2.tar.gz

Download URL jsonpath_rfc9535-2.0.2.tar.gz
Size 146.8 kB
Tags Source
SHA-256 checksum
How to use checksums
07e5ba16067905b5e8c0ff3a49184908f6e90f8cde473638f9f387b4f24d4e00
BLAKE2b-256 checksum
How to use checksums
1d0c4a274cfb022464458be05a5029388a85c10536de2524ee49b3b01806d4ad
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.2-py3-none-any.whl

Download URL jsonpath_rfc9535-2.0.2-py3-none-any.whl
Size 32.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8fd8054619bef2cac7ad04fc3a686ad8a3c552aa9a40f246bd7acef75ac779c
BLAKE2b-256 checksum
How to use checksums
e8fa3d124fe4cc1f48190555df4288e83a004977bd4adaa333b40abad479587a
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

This release

2.0.2 This release

2 release files

2.0.1

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