{"id":23395944,"url":"https://github.com/matthewdeanmartin/untruncate_json","last_synced_at":"2025-07-06T11:34:17.596Z","repository":{"id":210579408,"uuid":"726842600","full_name":"matthewdeanmartin/untruncate_json","owner":"matthewdeanmartin","description":"Python library to repair truncated json. Translated directly from the typescript original version","archived":false,"fork":false,"pushed_at":"2024-12-24T01:35:47.000Z","size":51,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T10:21:33.252Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/matthewdeanmartin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.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}},"created_at":"2023-12-03T15:09:24.000Z","updated_at":"2025-03-21T21:03:34.000Z","dependencies_parsed_at":"2023-12-03T20:27:05.633Z","dependency_job_id":"cbfb9216-2463-4fa1-9241-debed05ed938","html_url":"https://github.com/matthewdeanmartin/untruncate_json","commit_stats":null,"previous_names":["matthewdeanmartin/untruncate_json"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewdeanmartin%2Funtruncate_json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewdeanmartin%2Funtruncate_json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewdeanmartin%2Funtruncate_json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewdeanmartin%2Funtruncate_json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthewdeanmartin","download_url":"https://codeload.github.com/matthewdeanmartin/untruncate_json/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248414991,"owners_count":21099585,"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":[],"created_at":"2024-12-22T07:19:45.067Z","updated_at":"2025-04-11T14:13:11.001Z","avatar_url":"https://github.com/matthewdeanmartin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# untruncate_json\nPython library to repair truncated json. Translated directly from the typescript original version\n\n## Installation\n\n```bash\npip install untruncate_json\n```\n## Usage\n\nIn some cases, a partial json document is invalid and there is no way to recover. A common scenario using OpenAI's chatbot is that the AI created json is truncated at the end of the document. This library will attempt to repair the json by adding the missing closing brackets.\n\nIf the context of the json is relatively simple and holds natural language, truncating the text might not degrade the final result much.\n\n```python\nimport untruncate_json\nassert untruncate_json.complete('{\"foo\": \"bar') == '{\"foo\": \"bar\"}'\n```\n\n## Goals\nMy goal is for the library to be a pure python library that handles as many cases as the other libraries.\n\n## Credits\nOriginal Typescript version by dphilipson, MIT license. Code translated by a lazy ChatGPT that didn't\nwant to translate the long switch blocks. Copilot translated the switch blocks.\n\n## Prior Art\n\n- [untruncate-json](https://github.com/dphilipson/untruncate-json) - Original Typescript version\n- [truncjson](https://pypi.org/project/truncjson/) Cython implementation\n- [jsonfixer](https://pypi.org/project/jsonfixer/) Fork of half-json?\n- [half-json](https://pypi.org/project/halfjson/)\n\n## Benchmarks\n\n- truncjson: 1.28\n- untruncate_json: 11.39\n- untruncate_json: 1.14 (if you run `mypyc untruncate_json`\n- jsonfixer: 23.06\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewdeanmartin%2Funtruncate_json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthewdeanmartin%2Funtruncate_json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewdeanmartin%2Funtruncate_json/lists"}