{"id":21283390,"url":"https://github.com/jg-rp/python-jsonpath","last_synced_at":"2025-10-09T22:42:46.262Z","repository":{"id":148454911,"uuid":"617527148","full_name":"jg-rp/python-jsonpath","owner":"jg-rp","description":"A flexible JSONPath engine for Python with JSON Pointer and JSON Patch","archived":false,"fork":false,"pushed_at":"2025-09-13T08:01:07.000Z","size":2166,"stargazers_count":53,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-03T12:48:41.435Z","etag":null,"topics":["async","json","json-pointer","jsonpatch","jsonpath","jsonpath-expression","jsonpath-parser","jsonpath-syntax","jsonpointer","pypy3","python","python3"],"latest_commit_sha":null,"homepage":"https://jg-rp.github.io/python-jsonpath/","language":"Python","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/jg-rp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.txt","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},"funding":{"github":"jg-rp"}},"created_at":"2023-03-22T15:16:59.000Z","updated_at":"2025-10-03T04:15:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"21ba09d8-b49f-42af-9947-e2857a74c868","html_url":"https://github.com/jg-rp/python-jsonpath","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/jg-rp/python-jsonpath","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jg-rp%2Fpython-jsonpath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jg-rp%2Fpython-jsonpath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jg-rp%2Fpython-jsonpath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jg-rp%2Fpython-jsonpath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jg-rp","download_url":"https://codeload.github.com/jg-rp/python-jsonpath/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jg-rp%2Fpython-jsonpath/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002112,"owners_count":26083307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["async","json","json-pointer","jsonpatch","jsonpath","jsonpath-expression","jsonpath-parser","jsonpath-syntax","jsonpointer","pypy3","python","python3"],"created_at":"2024-11-21T11:08:10.354Z","updated_at":"2025-10-09T22:42:46.256Z","avatar_url":"https://github.com/jg-rp.png","language":"Python","readme":"\u003ch1 align=\"center\"\u003ePython JSONPath\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\nA flexible JSONPath engine for Python.\n\u003cbr\u003e\nWe follow \u003ca href=\"https://datatracker.ietf.org/doc/html/rfc9535\"\u003eRFC 9535\u003c/a\u003e and test against the \u003ca href=\"https://github.com/jsonpath-standard/jsonpath-compliance-test-suite\"\u003eJSONPath Compliance Test Suite\u003c/a\u003e.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jg-rp/python-jsonpath/blob/main/LICENSE.txt\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/l/python-jsonpath?style=flat-square\" alt=\"License\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/jg-rp/python-jsonpath/actions\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/jg-rp/python-jsonpath/tests.yaml?branch=main\u0026label=tests\u0026style=flat-square\" alt=\"Tests\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/python-jsonpath\"\u003e\n    \u003cimg alt=\"PyPI - Downloads\" src=\"https://img.shields.io/pypi/dm/python-jsonpath?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://pypi.org/project/python-jsonpath\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/python-jsonpath.svg?style=flat-square\" alt=\"PyPi - Version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/python-jsonpath\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/pyversions/python-jsonpath.svg?style=flat-square\" alt=\"Python versions\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n**Table of Contents**\n\n- [Install](#install)\n- [Links](#links)\n- [Related projects](#related-projects)\n- [Examples](#examples)\n- [License](#license)\n\n## Install\n\nInstall Python JSONPath using [pip](https://pip.pypa.io/en/stable/getting-started/):\n\n```\npip install python-jsonpath\n```\n\nOr [Pipenv](https://pipenv.pypa.io/en/latest/):\n\n```\npipenv install -u python-jsonpath\n```\n\nOr from [conda-forge](https://anaconda.org/conda-forge/python-jsonpath):\n\n```\nconda install -c conda-forge python-jsonpath\n```\n\n## Links\n\n- Documentation: https://jg-rp.github.io/python-jsonpath/.\n- JSONPath Syntax: https://jg-rp.github.io/python-jsonpath/syntax/\n- Change log: https://github.com/jg-rp/python-jsonpath/blob/main/CHANGELOG.md\n- PyPi: https://pypi.org/project/python-jsonpath\n- Source code: https://github.com/jg-rp/python-jsonpath\n- Issue tracker: https://github.com/jg-rp/python-jsonpath/issues\n\n## Related projects\n\n- [JSONPath RFC 9535](https://github.com/jg-rp/python-jsonpath-rfc9535) - A minimal, slightly cleanr Python implementation of RFC 9535. If you're not interested JSONPath sytax beyond that defined in RFC 9535, you might choose [jsonpath-rfc9535](https://pypi.org/project/jsonpath-rfc9535/) over [python-jsonpath](https://pypi.org/project/python-jsonpath/).\n\n  jsonpath-rfc9535 also includes utilities for verifying and testing the [JSONPath Compliance Test Suite](https://github.com/jsonpath-standard/jsonpath-compliance-test-suite). Most notably the nondeterministic behavior of some JSONPath selectors.\n\n- [JSON P3](https://github.com/jg-rp/json-p3) - RFC 9535 implemented in TypeScript. JSON P3 does not include all the non-standard features of Python JSONPath, but does define some optional [extra syntax](https://jg-rp.github.io/json-p3/guides/jsonpath-extra).\n\n- [Ruby JSON P3](https://github.com/jg-rp/ruby-json-p3) - RFC 9535, RFC 6901 and RFC 6902 implemented in Ruby.\n\n## Examples\n\n### JSONPath\n\n```python\nimport jsonpath\n\ndata = {\n    \"users\": [\n        {\"name\": \"Sue\", \"score\": 100},\n        {\"name\": \"John\", \"score\": 86},\n        {\"name\": \"Sally\", \"score\": 84},\n        {\"name\": \"Jane\", \"score\": 55},\n    ]\n}\n\nuser_names = jsonpath.findall(\"$.users[?@.score \u003c 100].name\", data)\nprint(user_names) # ['John', 'Sally', 'Jane']\n```\n\n### JSON Pointer\n\nWe include an [RFC 6901](https://datatracker.ietf.org/doc/html/rfc6901) compliant implementation of JSON Pointer. See JSON Pointer [quick start](https://jg-rp.github.io/python-jsonpath/quickstart/#pointerresolvepointer-data), [guide](https://jg-rp.github.io/python-jsonpath/pointers/) and [API reference](https://jg-rp.github.io/python-jsonpath/api/#jsonpath.JSONPointer)\n\n```python\nfrom jsonpath import pointer\n\ndata = {\n    \"users\": [\n        {\"name\": \"Sue\", \"score\": 100},\n        {\"name\": \"John\", \"score\": 86},\n        {\"name\": \"Sally\", \"score\": 84},\n        {\"name\": \"Jane\", \"score\": 55},\n    ]\n}\n\nsue_score = pointer.resolve(\"/users/0/score\", data)\nprint(sue_score)  # 100\n\njane_score = pointer.resolve([\"users\", 3, \"score\"], data)\nprint(jane_score)  # 55\n```\n\n### JSON Patch\n\nWe also include an [RFC 6902](https://datatracker.ietf.org/doc/html/rfc6902) compliant implementation of JSON Patch. See JSON Patch [quick start](https://jg-rp.github.io/python-jsonpath/quickstart/#patchapplypatch-data) and [API reference](https://jg-rp.github.io/python-jsonpath/api/#jsonpath.JSONPatch)\n\n```python\nfrom jsonpath import patch\n\npatch_operations = [\n    {\"op\": \"add\", \"path\": \"/some/foo\", \"value\": {\"foo\": {}}},\n    {\"op\": \"add\", \"path\": \"/some/foo\", \"value\": {\"bar\": []}},\n    {\"op\": \"copy\", \"from\": \"/some/other\", \"path\": \"/some/foo/else\"},\n    {\"op\": \"add\", \"path\": \"/some/foo/bar/-\", \"value\": 1},\n]\n\ndata = {\"some\": {\"other\": \"thing\"}}\npatch.apply(patch_operations, data)\nprint(data) # {'some': {'other': 'thing', 'foo': {'bar': [1], 'else': 'thing'}}}\n\n```\n\n## License\n\n`python-jsonpath` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.\n","funding_links":["https://github.com/sponsors/jg-rp"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjg-rp%2Fpython-jsonpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjg-rp%2Fpython-jsonpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjg-rp%2Fpython-jsonpath/lists"}