{"id":34110107,"url":"https://github.com/ddfs/python-json-doc","last_synced_at":"2026-03-10T18:07:27.725Z","repository":{"id":62572850,"uuid":"158929625","full_name":"ddfs/python-json-doc","owner":"ddfs","description":"Utility functions for JSON Document","archived":false,"fork":false,"pushed_at":"2018-11-26T12:08:12.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T10:38:45.955Z","etag":null,"topics":["json","json-pointer","python","utility-function"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ddfs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES","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":"2018-11-24T11:28:35.000Z","updated_at":"2018-11-26T12:08:14.000Z","dependencies_parsed_at":"2022-11-03T18:26:48.993Z","dependency_job_id":null,"html_url":"https://github.com/ddfs/python-json-doc","commit_stats":null,"previous_names":["ddfs/json-doc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ddfs/python-json-doc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddfs%2Fpython-json-doc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddfs%2Fpython-json-doc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddfs%2Fpython-json-doc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddfs%2Fpython-json-doc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddfs","download_url":"https://codeload.github.com/ddfs/python-json-doc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddfs%2Fpython-json-doc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30346559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"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":["json","json-pointer","python","utility-function"],"created_at":"2025-12-14T18:44:47.499Z","updated_at":"2026-03-10T18:07:27.715Z","avatar_url":"https://github.com/ddfs.png","language":"Python","readme":"# python-json-doc\nUtility functions for JSON Document\n\n[![Build Status](https://travis-ci.org/ddfs/python-json-doc.svg?branch=master)](https://travis-ci.org/ddfs/python-json-doc)\n[![Coverage Status](https://coveralls.io/repos/github/ddfs/python-json-doc/badge.svg?branch=master)](https://coveralls.io/github/ddfs/python-json-doc?branch=master)\n[![GitHub license](https://img.shields.io/github/license/ddfs/python-json-doc.svg)](https://github.com/ddfs/python-json-doc/blob/master/LICENSE)\n\nIt can handle get/set/pop/has operations on nodes\n\nExtended `set` functions for lists:\n- append: appends to the list\n- extend: extends the list\n- replace: `search` and replace in the list  \n- replace_re: `search` and replace in the list using regular expression\n\nNo external dependencies. Tests requires `unittest2` module\n\nCompatible with Python 2.6+ and 3.3+ \n\n\nExamples\n---\n```python \ndoc = {\n    'a': {\n        'deep': {\n            'nested': {\n                'list': [1, 2, 3, {'dict': 'OK'}],\n                'string': 'string',\n                'hex': 0x010101\n            }\n        },\n    },\n    'list': [1, 2, 3]\n}\n\n# get\nprint json_doc_get(doc, '/a/deep/nested/list/3/dict')\n\u003e\u003e OK\n\n# set\nprint json_doc_set(doc, '/a/deep/nested/string', 'new string')['a']['deep']['nested']['string']\n\u003e\u003e new string\n\n# pop: target exist\nprint json_doc_pop(doc, '/a/deep/nested/list/2')\n\u003e\u003e True\n\n# pop: target doesn't exist\nprint json_doc_pop(doc, '/a/deep/nested/list/5')\n\u003e\u003e False\n\n# has item\nprint json_doc_has(doc, '/a/deep/nested/list/3/dict')\n\u003e\u003e True\n\n# has item with value\nprint json_doc_has(doc, '/a/deep/nested/list/3/dict', 'OK')\n\u003e\u003e True\n\n## List only functions\n\n# append\nprint json_doc_append(doc, '/list', 4)['list']\n[1, 2, 3, 4]\n\n# extend\nprint json_doc_extend(doc, '/list', [5, 6, 7])['list']\n[1, 2, 3, 4, 5, 6, 7]\n\n# replace: value -\u003e new value, search -\u003e old value\nprint json_doc_replace(doc, '/list', 44, 4)['list']\n[1, 2, 3, 44, 5, 6, 7]\n\n# replace_re: -\u003e new value, search -\u003e regex\n[111, 2, 3, 44, 5, 6, 7]\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddfs%2Fpython-json-doc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddfs%2Fpython-json-doc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddfs%2Fpython-json-doc/lists"}