{"library":"python-jsonpath","title":"JSONPath, JSON Pointer and JSON Patch for Python","description":"Python JSONPath is a flexible engine for processing JSONPath, JSON Pointer, and JSON Patch expressions. It aims to be compliant with RFC 9535 for JSONPath, RFC 6901 for JSON Pointer, and RFC 6902 for JSON Patch. The library is currently at version 2.0.2 and receives regular updates and maintenance, often with a few releases per year.","language":"python","status":"active","last_verified":"Fri May 15","install":{"commands":["pip install python-jsonpath"],"cli":null},"imports":["import jsonpath"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import jsonpath\n\ndata = {\n    \"store\": {\n        \"book\": [\n            {\"category\": \"reference\", \"author\": \"Nigel Rees\", \"title\": \"Sayings of the Century\", \"price\": 8.95},\n            {\"category\": \"fiction\", \"author\": \"Evelyn Waugh\", \"title\": \"Sword of Honour\", \"price\": 12.99},\n            {\"category\": \"fiction\", \"author\": \"Herman Melville\", \"title\": \"Moby Dick\", \"isbn\": \"0-553-21311-3\", \"price\": 8.99},\n            {\"category\": \"fiction\", \"author\": \"J. R. R. Tolkien\", \"title\": \"The Lord of the Rings\", \"isbn\": \"0-395-19395-8\", \"price\": 22.99}\n        ],\n        \"bicycle\": {\"color\": \"red\", \"price\": 19.95}\n    },\n    \"expensive\": 10\n}\n\n# Find the titles of all books\nbook_titles = jsonpath.findall(\"$.store.book[*].title\", data)\nprint(f\"Book Titles: {book_titles}\")\n\n# Find all books cheaper than $10\ncheap_books = jsonpath.findall(\"$.store.book[?(@.price < 10)].title\", data)\nprint(f\"Cheap Book Titles: {cheap_books}\")\n\n# Compile a JSONPath expression for repeated use\ncompiled_path = jsonpath.compile(\"$.store.book[?(@.category == 'fiction')].author\")\nfiction_authors = compiled_path.findall(data)\nprint(f\"Fiction Authors: {fiction_authors}\")","lang":"python","description":"This quickstart demonstrates basic JSONPath queries using `findall()` and `compile()` to extract data from a sample JSON structure. It shows how to select elements, filter by conditions, and compile paths for efficiency.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-15","installed_version":"2.0.2","pypi_latest":"2.0.2","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":1.6,"avg_import_s":0.61,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"python-jsonpath","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.34,"mem_mb":3.1,"disk_size":"18.4M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"python-jsonpath","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.5,"import_time_s":0.2,"mem_mb":3.1,"disk_size":"19M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"python-jsonpath","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.16,"mem_mb":3.5,"disk_size":"20.4M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"python-jsonpath","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.6,"import_time_s":1.01,"mem_mb":3.5,"disk_size":"21M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"python-jsonpath","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.68,"mem_mb":3.5,"disk_size":"12.3M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"python-jsonpath","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.5,"import_time_s":0.78,"mem_mb":3.5,"disk_size":"13M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"python-jsonpath","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.66,"mem_mb":3.6,"disk_size":"12.0M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"python-jsonpath","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.5,"import_time_s":0.74,"mem_mb":3.4,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"python-jsonpath","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.31,"mem_mb":3.1,"disk_size":"17.9M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"python-jsonpath","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.8,"import_time_s":0.25,"mem_mb":3.1,"disk_size":"18M"}]}}