{"id":17347998,"url":"https://github.com/jelchison/sort-json","last_synced_at":"2026-05-01T01:31:34.779Z","repository":{"id":80501384,"uuid":"111231205","full_name":"JElchison/sort-json","owner":"JElchison","description":"Python script that sorts a JSON object according to its keys.  Useful for diff'ing two JSON files.","archived":false,"fork":false,"pushed_at":"2020-09-10T11:13:55.000Z","size":15,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T11:22:01.448Z","etag":null,"topics":["compare","deterministic","diff","json","python","python2","serialize","sort"],"latest_commit_sha":null,"homepage":null,"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/JElchison.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}},"created_at":"2017-11-18T19:00:59.000Z","updated_at":"2022-03-17T20:22:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"6063aa7a-3552-4a23-89a3-d93a380ce0be","html_url":"https://github.com/JElchison/sort-json","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/JElchison/sort-json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JElchison%2Fsort-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JElchison%2Fsort-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JElchison%2Fsort-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JElchison%2Fsort-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JElchison","download_url":"https://codeload.github.com/JElchison/sort-json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JElchison%2Fsort-json/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32482460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: 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":["compare","deterministic","diff","json","python","python2","serialize","sort"],"created_at":"2024-10-15T16:50:47.742Z","updated_at":"2026-05-01T01:31:34.760Z","avatar_url":"https://github.com/JElchison.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sort-json\nPython script that sorts a JSON object according to its keys.\n\nThe product of this script is deterministic, so this is useful for diff'ing two JSON files.\n\n## Example Usage\n\nSort a JSON file:\n```\nuser@computer:~$ cat abc.json \n{\n    \"c\": 0,\n    \"b\": 0,\n    \"a\": {\n      \"a3\": 1,\n      \"a2\": 2,\n      \"a1\": 3\n    }\n}\nuser@computer:~$ ./sort-json.py abc.json \n{\n    \"a\": {\n        \"a1\": 3,\n        \"a2\": 2,\n        \"a3\": 1\n    },\n    \"b\": 0,\n    \"c\": 0\n}\n```\n\nDiff two JSON files:\n```\nuser@computer:~$ cat abcd.json \n{\n    \"d\": 0,\n    \"c\": 0,\n    \"b\": 0,\n    \"a\": {\n      \"a3\": 1,\n      \"a2\": 2,\n      \"a1\": 3\n    }\n}\nuser@computer:~$ diff \u003c(./sort-json.py abc.json) \u003c(./sort-json.py abcd.json)\n8c8,9\n\u003c     \"c\": 0\n---\n\u003e     \"c\": 0,\n\u003e     \"d\": 0\n```\n\n## References\n\n* https://docs.python.org/2/library/json.html#json.dump\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjelchison%2Fsort-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjelchison%2Fsort-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjelchison%2Fsort-json/lists"}