{"id":19150576,"url":"https://github.com/night-crawler/jsonpath-rust-bindings","last_synced_at":"2026-03-04T12:03:08.695Z","repository":{"id":205482422,"uuid":"714339868","full_name":"night-crawler/jsonpath-rust-bindings","owner":"night-crawler","description":"Bindings for jsonpath-rust library","archived":false,"fork":false,"pushed_at":"2025-11-16T18:48:42.000Z","size":49,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-16T20:21:39.615Z","etag":null,"topics":["jsonpath","jsonpath-parser","jsonpath-query","maturin","pyo3","python","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/night-crawler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-04T16:09:36.000Z","updated_at":"2025-11-16T18:26:46.000Z","dependencies_parsed_at":"2024-11-09T08:12:29.636Z","dependency_job_id":"96ac1fa9-3e89-432d-b9b4-26a72504c94d","html_url":"https://github.com/night-crawler/jsonpath-rust-bindings","commit_stats":null,"previous_names":["night-crawler/jsonpath-rust-bindings"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/night-crawler/jsonpath-rust-bindings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-crawler%2Fjsonpath-rust-bindings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-crawler%2Fjsonpath-rust-bindings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-crawler%2Fjsonpath-rust-bindings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-crawler%2Fjsonpath-rust-bindings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/night-crawler","download_url":"https://codeload.github.com/night-crawler/jsonpath-rust-bindings/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-crawler%2Fjsonpath-rust-bindings/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30079565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T11:57:42.557Z","status":"ssl_error","status_checked_at":"2026-03-04T11:56:10.793Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jsonpath","jsonpath-parser","jsonpath-query","maturin","pyo3","python","rust"],"created_at":"2024-11-09T08:12:22.381Z","updated_at":"2026-03-04T12:03:03.666Z","avatar_url":"https://github.com/night-crawler.png","language":"Rust","readme":"# jsonpath-rust-bindings\n\n![PyPI - Downloads](https://img.shields.io/pypi/dm/jsonpath-rust-bindings)\n![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/night-crawler/jsonpath-rust-bindings/CI.yml)\n![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/night-crawler/jsonpath-rust-bindings/test.yml?label=tests)\n![piwheels (including prereleases)](https://img.shields.io/piwheels/v/jsonpath-rust-bindings)\n\nThis package contains Python bindings for [jsonpath-rust](https://github.com/besok/jsonpath-rust) library by [besok](https://github.com/besok).\n\nThe details regarding the JsonPath itself can be found [here](https://goessner.net/articles/JsonPath/).\n\n## Installation\n\n```bash\npip install jsonpath-rust-bindings\n```\n\n## Usage\n\n```python\nfrom jsonpath_rust_bindings import Finder\n\nsample = {\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                \"category\": \"fiction\",\n                \"author\": \"Herman Melville\",\n                \"title\": \"Moby Dick\",\n                \"isbn\": \"0-553-21311-3\",\n                \"price\": 8.99,\n            },\n            {\n                \"category\": \"fiction\",\n                \"author\": \"J. R. R. Tolkien\",\n                \"title\": \"The Lord of the Rings\",\n                \"isbn\": \"0-395-19395-8\",\n                \"price\": 22.99,\n            },\n        ],\n        \"bicycle\": {\"color\": \"red\", \"price\": 19.95},\n    },\n    \"expensive\": 10,\n}\n\nqueries = [\n    '$.store.book[*].author',\n    '$..book[?(@.isbn)]',\n    '$.store.*',\n    '$..author',\n    '$.store..price',\n    '$..book[2]',\n    # '$..book[-2]',\n    '$..book[0,1]',\n    '$..book[:2]',\n    '$..book[1:2]',\n    '$..book[-2:]',\n    '$..book[2:]',\n    '$.store.book[?(@.price\u003c10)]',\n    '$..book[?(@.price\u003c=$.expensive)]',\n    \"$..book[?(@.author ~= '.*Rees')].price\",\n    '$..*',\n]\n\nf = Finder(sample)\n\nfor query in queries:\n    print(query, f.find(query), '\\n')\n\n# You will see a bunch of found items like\n# $..book[?(@.author ~= '.*Rees')].price [JsonPathResult(data=8.95, path=Some(\"$.['store'].['book'][0].['price']\"), is_new_value=False)]\n\n```\n\n`JsonPathResult` has the following attributes:\n\n- data: the found value\n- path: the path to the found value\n\n`JsonPathResult` can't be constructed from Python; it is only returned by `Finder.find()`.\n\n## Caveats\n\nThe current implementation is cloning the original `PyObject` data when converting it to the serde `Value`.\nIt happens each time you're creating a new `Finder` instance. Try to reuse the same `Finder` instance for querying if it's possible.\n\nAlso, It has yet another consequence demonstrated in the following example:\n\n```python\n\u003e\u003e\u003e original_object_i_want_to_mutate = {'a': {'b': 'sample b'}}\n\u003e\u003e\u003e from jsonpath_rust_bindings import Finder\n\u003e\u003e\u003e f = Finder(original_object_i_want_to_mutate)\n\u003e\u003e\u003e b_dict = f.find('$.a')[0].data\n\u003e\u003e\u003e b_dict\n{'b': 'sample b'}\n\u003e\u003e\u003e b_dict['new'] = 42\n\u003e\u003e\u003e original_object_i_want_to_mutate\n{'a': {'b': 'sample b'}}\n```\n\n## Development\n\nClone the repository.\n\nUpdate maturin if needed:\n\n```bash\npip install maturin -U \n```\n\nAdd your changes, then run:\n\n```bash\nmaturin develop\n```\n\n\nUpdate CI:\n\n```bash\nmaturin generate-ci github \u003e ./.github/workflows/CI.yml\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnight-crawler%2Fjsonpath-rust-bindings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnight-crawler%2Fjsonpath-rust-bindings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnight-crawler%2Fjsonpath-rust-bindings/lists"}