{"id":13501855,"url":"https://github.com/xlwings/jsondiff","last_synced_at":"2025-12-11T22:48:13.733Z","repository":{"id":38860573,"uuid":"44523781","full_name":"xlwings/jsondiff","owner":"xlwings","description":"Diff JSON and JSON-like structures in Python","archived":false,"fork":false,"pushed_at":"2024-09-24T17:38:19.000Z","size":106,"stargazers_count":747,"open_issues_count":22,"forks_count":88,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-12-07T09:48:40.209Z","etag":null,"topics":["diff","json","python"],"latest_commit_sha":null,"homepage":"","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/xlwings.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2015-10-19T09:19:01.000Z","updated_at":"2025-11-30T19:43:45.000Z","dependencies_parsed_at":"2024-01-16T10:37:49.174Z","dependency_job_id":"ab6b2adc-c3f6-42dc-967a-8263e9fc9778","html_url":"https://github.com/xlwings/jsondiff","commit_stats":{"total_commits":113,"total_committers":24,"mean_commits":4.708333333333333,"dds":0.6460176991150443,"last_synced_commit":"31140ba8af02d068a5cca6cd123848a89dde1190"},"previous_names":["zoomeranalytics/jsondiff"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/xlwings/jsondiff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlwings%2Fjsondiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlwings%2Fjsondiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlwings%2Fjsondiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlwings%2Fjsondiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xlwings","download_url":"https://codeload.github.com/xlwings/jsondiff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlwings%2Fjsondiff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27616971,"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-12-09T02:00:09.185Z","response_time":54,"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":["diff","json","python"],"created_at":"2024-07-31T22:01:53.248Z","updated_at":"2025-12-11T22:48:13.717Z","avatar_url":"https://github.com/xlwings.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# jsondiff\n\nDiff JSON and JSON-like structures in Python.\n\n## Installation\n\n``pip install jsondiff``\n\n## Quickstart\n\n```python\n\u003e\u003e\u003e import jsondiff as jd\n\u003e\u003e\u003e from jsondiff import diff\n\n\u003e\u003e\u003e diff({'a': 1, 'b': 2}, {'b': 3, 'c': 4})\n{'c': 4, 'b': 3, delete: ['a']}\n\n\u003e\u003e\u003e diff(['a', 'b', 'c'], ['a', 'b', 'c', 'd'])\n{insert: [(3, 'd')]}\n\n\u003e\u003e\u003e diff(['a', 'b', 'c'], ['a', 'c'])\n{delete: [1]}\n\n# Typical diff looks like what you'd expect...\n\u003e\u003e\u003e diff({'a': [0, {'b': 4}, 1]}, {'a': [0, {'b': 5}, 1]})\n{'a': {1: {'b': 5}}}\n\n# You can exclude some jsonpaths from the diff (doesn't work if the value types are different)\n\u003e\u003e\u003e diff({'a': 1, 'b': {'b1': 20, 'b2': 21}, 'c': 3},  {'a': 1, 'b': {'b1': 22, 'b2': 23}, 'c': 30}, exclude_paths=['b.b1', 'c'])\n{'b': {'b2': 23}}\n\n# ...but similarity is taken into account\n\u003e\u003e\u003e diff({'a': [0, {'b': 4}, 1]}, {'a': [0, {'c': 5}, 1]})\n{'a': {insert: [(1, {'c': 5})], delete: [1]}}\n\n# Support for various diff syntaxes\n\u003e\u003e\u003e diff({'a': 1, 'b': 2}, {'b': 3, 'c': 4}, syntax='explicit')\n{insert: {'c': 4}, update: {'b': 3}, delete: ['a']}\n\n\u003e\u003e\u003e diff({'a': 1, 'b': 2}, {'b': 3, 'c': 4}, syntax='symmetric')\n{insert: {'c': 4}, 'b': [2, 3], delete: {'a': 1}}\n\n\u003e\u003e\u003e diff({'list': [1, 2, 3], \"poplist\": [1, 2, 3]}, {'list': [1, 3]}, syntax=\"rightonly\")\n{\"list\": [1, 3], delete: [\"poplist\"]}\n\n# Special handling of sets\n\u003e\u003e\u003e diff({'a', 'b', 'c'}, {'a', 'c', 'd'})\n{discard: set(['b']), add: set(['d'])}\n\n# Load and dump JSON\n\u003e\u003e\u003e print diff('[\"a\", \"b\", \"c\"]', '[\"a\", \"c\", \"d\"]', load=True, dump=True)\n{\"$delete\": [1], \"$insert\": [[2, \"d\"]]}\n\n# NOTE: Default keys in the result are objects, not strings!\n\u003e\u003e\u003e d = diff({'a': 1, 'delete': 2}, {'b': 3, 'delete': 4})\n\u003e\u003e\u003e d\n{'delete': 4, 'b': 3, delete: ['a']}\n\u003e\u003e\u003e d[jd.delete]\n['a']\n\u003e\u003e\u003e d['delete']\n4\n# Alternatively, you can use marshal=True to get back strings with a leading $\n\u003e\u003e\u003e diff({'a': 1, 'delete': 2}, {'b': 3, 'delete': 4}, marshal=True)\n{'delete': 4, 'b': 3, '$delete': ['a']}\n```\n\n## Command Line Client\n\nUsage:\n```\njdiff [-h] [-p] [-s {compact,symmetric,explicit}] [-i INDENT] [-f {json,yaml}] first second\n\npositional arguments:\n  first\n  second\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -p, --patch\n  -s {compact,symmetric,explicit}, --syntax {compact,symmetric,explicit}\n                        Diff syntax controls how differences are rendered (default: compact)\n  -i INDENT, --indent INDENT\n                        Number of spaces to indent. None is compact, no indentation. (default: None)\n  -f {json,yaml}, --format {json,yaml}\n                        Specify file format for input and dump (default: json)\n```\n\nExamples:\n\n```bash\n$ jdiff a.json b.json -i 2\n\n$ jdiff a.json b.json -i 2 -s symmetric\n\n$ jdiff a.yaml b.yaml -f yaml -s symmetric\n```\n\n## Development\n\nInstall development dependencies and test locally with\n\n```bash\npip install -r requirements-dev.txt\n# ... do your work ... add tests ...\npytest\n```\n\n## Installing From Source\n\nTo install from source run\n\n```bash\npip install .\n```\n\nThis will install the library and cli for `jsondiff` as well as its runtime\ndependencies.\n\n\n## Testing before release\n\n```bash\npython -m build\ntwine check dist/*\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxlwings%2Fjsondiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxlwings%2Fjsondiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxlwings%2Fjsondiff/lists"}