{"id":9849,"library":"jsonpath-rust-bindings","title":"Python JSONPath Rust Bindings","description":"Python bindings for the high-performance `jsonpath-rust` library, enabling fast JSONPath querying of Python dictionaries. It's currently at version 1.1.1 and has a relatively stable release cadence, focusing on minor updates and bug fixes.","status":"active","version":"1.1.1","language":"en","source_language":"en","source_url":"https://github.com/lalitkapoor/jsonpath-rust-bindings","tags":["json","jsonpath","rust","query","data","parsing","performance"],"install":[{"cmd":"pip install jsonpath-rust-bindings","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"note":"The `JsonPath` class is the primary entry point for parsing and querying.","symbol":"JsonPath","correct":"from jsonpath_rust import JsonPath"}],"quickstart":{"code":"from jsonpath_rust import JsonPath\n\ndata = {\n    \"store\": {\n        \"book\": [\n            {\n                \"category\": \"reference\",\n                \"author\": \"Nigel Rees\",\n                \"title\": \"Sayings of the Century\",\n                \"price\": 8.95\n            },\n            {\n                \"category\": \"fiction\",\n                \"author\": \"Evelyn Waugh\",\n                \"title\": \"Sword of Honour\",\n                \"price\": 12.99\n            }\n        ],\n        \"bicycle\": {\n            \"color\": \"red\",\n            \"price\": 19.95\n        }\n    }\n}\n\njsonpath = JsonPath.parse('$.store.book[*].author')\nresult = jsonpath.find(data)\nprint(result)","lang":"python","description":"Parses a JSONPath expression and applies it to a Python dictionary, returning matching elements."},"warnings":[{"fix":"Migrate to using the `JsonPath` class methods: `JsonPath.parse(path_string)` followed by `jsonpath_object.find(data)`.","message":"The API for parsing and querying JSONPaths changed significantly in version 1.0.0. Module-level functions like `jsonpath_rust.parse()` and `jsonpath_rust.select()` were removed.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Consult the JSONPath specification that `jsonpath-rust` aims to follow or test your paths thoroughly with the library to ensure compatibility.","message":"Ensure your JSONPath syntax adheres strictly to the `jsonpath-rust` implementation. It may differ subtly from other JSONPath engines or custom implementations, especially concerning advanced features or edge cases.","severity":"gotcha","affected_versions":"All"},{"fix":"Profile your application to identify bottlenecks. For static JSONPaths, parse them once using `JsonPath.parse()` and reuse the `JsonPath` object across multiple queries.","message":"While highly performant due to Rust, querying extremely large or deeply nested JSON documents repeatedly may still incur performance costs within Python's object model.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Use `JsonPath.parse()` and `jsonpath_object.find()` methods instead. Example: `jsonpath = JsonPath.parse('$.your.path'); result = jsonpath.find(data)`.","cause":"Attempting to use the pre-1.0.0 module-level `parse` function after upgrading to version 1.0.0 or later.","error":"AttributeError: module 'jsonpath_rust' has no attribute 'parse'"},{"fix":"Review your JSONPath string for syntax errors. Ensure it matches the JSONPath specification supported by `jsonpath-rust`. Common issues include unclosed brackets, incorrect operators, or invalid segment names.","cause":"Invalid JSONPath syntax provided to `JsonPath.parse()`.","error":"jsonpath_rust.errors.JsonpathError: Parse error at position X: Expected Y, found Z"},{"fix":"Install the library using `pip install jsonpath-rust-bindings`. If using virtual environments, ensure the correct environment is activated.","cause":"The `jsonpath-rust-bindings` library is not installed, or the Python environment where it was installed is not active.","error":"ModuleNotFoundError: No module named 'jsonpath_rust'"}]}