{"id":18859783,"url":"https://github.com/sty945/jsonsearch","last_synced_at":"2025-10-19T02:27:27.608Z","repository":{"id":62572956,"uuid":"367268390","full_name":"sty945/jsonsearch","owner":"sty945","description":":axe: Json数据查找元素利器（JsonSearch is a simple, yet effcient python library for searhing specific elements in json data. ）","archived":false,"fork":false,"pushed_at":"2022-10-30T14:53:44.000Z","size":20,"stargazers_count":30,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T01:26:02.157Z","etag":null,"topics":["json","json-data"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sty945.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}},"created_at":"2021-05-14T06:20:35.000Z","updated_at":"2024-12-09T07:17:33.000Z","dependencies_parsed_at":"2022-11-03T18:31:34.126Z","dependency_job_id":null,"html_url":"https://github.com/sty945/jsonsearch","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sty945%2Fjsonsearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sty945%2Fjsonsearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sty945%2Fjsonsearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sty945%2Fjsonsearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sty945","download_url":"https://codeload.github.com/sty945/jsonsearch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248602276,"owners_count":21131614,"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","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":["json","json-data"],"created_at":"2024-11-08T04:19:12.272Z","updated_at":"2025-10-19T02:27:27.456Z","avatar_url":"https://github.com/sty945.png","language":"Python","readme":"\n# JsonSearch\n[![](https://img.shields.io/badge/pypi-jsonsearch-brightgreen)](https://pypi.org/project/jsonsearch/)\n\n\nJsonSearch is a simple, yet effcient python library for searhing specific elements in json data.\n\n```\n\u003e\u003e\u003e from jsonsearch import JsonSearch\n\u003e\u003e\u003e test_data = {\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\": {\n...             \"color\": \"red\",\n...             \"price\": 19.95\n...         }\n...     },\n...     \"expensive\": 10\n... }\n\u003e\u003e\u003e jsondata = JsonSearch(object=test_data, mode='j')\n\u003e\u003e\u003e jsondata.search_all_value(key='title')               \n['Sayings of the Century', 'Sword of Honour', 'Moby Dick', 'The Lord of the Rings']\n\u003e\u003e\u003e jsondata.search_all_path(key='title')       \n[['store', 'book', 0, 'title'], ['store', 'book', 1, 'title'], ['store', 'book', 2, 'title'], ['store', 'book', 3, 'title']]\n\u003e\u003e\u003e jsondata.search_first_value(key='title')           \n'Sayings of the Century'\n\u003e\u003e\u003e jsondata.search_first_path(key='title')      \n['store', 'book', 0, 'title']\n```\n\nWhen json data have nested objects, JsonSearch allows you to find specific elements in json data easily.\n\nTake the program above as an example, if you want to get the first `'title'` value in data, you don't need to use `test_data['store']['book'][0]['title']` anymore, you can just use `jsondata.search_first_value(key='title')`.\n\n\n# Install \n\nJsonSearch is available on PyPI:\n\n```\n pip install jsonsearch\n```\n\nor \n\n```\npip install --index-url https://pypi.org/simple/jsonsearch\n```\n\n\n# 中文教程\n\n中文使用方式请查看[这里](https://sty945.blog.csdn.net/article/details/117379412)\n\n\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsty945%2Fjsonsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsty945%2Fjsonsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsty945%2Fjsonsearch/lists"}