{"id":405,"library":"jsonpointer","title":"JSON Pointer for Python","description":"A Python library for identifying specific nodes in a JSON document, implementing RFC 6901. Current version: 3.1.1. Release cadence: Regular updates with active maintenance.","status":"active","version":"3.1.1","language":"python","source_language":"en","source_url":"https://github.com/stefankoegl/python-json-pointer","tags":["json","pointer","RFC 6901","Python"],"install":[{"cmd":"pip install jsonpointer","lang":"bash","label":"Install jsonpointer"}],"dependencies":[],"imports":[{"note":"Ensure correct import path to access JsonPointer class","symbol":"JsonPointer","correct":"from jsonpointer import JsonPointer"}],"quickstart":{"code":"import json\nfrom jsonpointer import JsonPointer\n\n# Sample JSON document\njson_data = {\n    \"store\": {\n        \"book\": [\n            {\"category\": \"reference\",\n             \"author\": \"Nigel Rees\",\n             \"title\": \"Sayings of the Century\",\n             \"price\": 8.95\n            },\n            {\"category\": \"fiction\",\n             \"author\": \"Evelyn Waugh\",\n             \"title\": \"Sword of Honour\",\n             \"price\": 12.99\n            }\n        ]\n    }\n}\n\n# Create a JsonPointer instance\npointer = JsonPointer('/store/book/0/author')\n\n# Resolve the pointer to get the value\nauthor = pointer.resolve(json_data)\nprint(author)  # Output: Nigel Rees","lang":"python","description":"Demonstrates how to use JsonPointer to access a specific value in a JSON document."},"warnings":[{"fix":"Use 'from jsonpointer import JsonPointer' to import the class.","message":"Ensure correct import path to access JsonPointer class","severity":"breaking","affected_versions":"3.1.1"}],"env_vars":null,"last_verified":"2026-05-12T13:36:43.476Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"pip install jsonpointer","cause":"The 'jsonpointer' package has not been installed in your Python environment.","error":"ModuleNotFoundError: No module named 'jsonpointer'"},{"fix":"Ensure the array index specified in the JSON pointer is within the valid range (0 to length-1) for the target array. You can inspect the JSON document or add logic to check array bounds before applying the pointer.","cause":"The JSON pointer attempts to access an array index that is outside the bounds of the array in the JSON document.","error":"jsonpointer.JsonPointerException: index X out of bounds in [...]"},{"fix":"Correct the JSON pointer string to begin with a '/' (e.g., change 'foo/bar' to '/foo/bar') or use an empty string '' for the root document.","cause":"The provided JSON pointer string does not conform to RFC 6901, as it does not start with a '/' character (unless it's an empty string for the root document).","error":"jsonpointer.JsonPointerException: JSON pointer must be empty or begin with '/'"},{"fix":"Provide a 'default' argument to jsonpointer.resolve(doc, pointer, default=None) or JsonPointer(pointer).get(doc, default=None) to return a specified value instead of raising a KeyError when the path is not found. Alternatively, ensure the JSON document structure matches the expected pointer path or explicitly check for key existence.","cause":"When using jsonpointer.resolve() or JsonPointer().get() without a 'default' argument, a KeyError is raised if a segment of the pointer path references a key that does not exist in a dictionary within the JSON document.","error":"KeyError: 'some_key'"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0.2,"disk_size":"17.8M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0.2,"disk_size":"18M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.01,"mem_mb":0.2,"disk_size":"19.6M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0.2,"disk_size":"20M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0.2,"disk_size":"11.5M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0.2,"disk_size":"12M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0.4,"disk_size":"11.1M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0.2,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0.2,"disk_size":"17.3M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0.2,"disk_size":"18M"}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}