{"repo":"mangiucugna/json_repair","free":true,"listed":false,"github":"https://github.com/mangiucugna/json_repair","clone":"git clone https://github.com/mangiucugna/json_repair.git","description":"Repair malformed JSON from LLMs, APIs, logs, and user input in Python.","language":"Python","stars":5070,"topics":["json","llm","parser","cli","json-repair","json-schema","llm-output","malformed-json","pydantic","python"],"license":"MIT","category":"ai-agents","readme_excerpt":"English 中文 json repair Repair malformed JSON from LLMs, APIs, logs, and user input in Python. - Fix missing quotes, commas, brackets, comments, stray prose, and truncated values. - Use it as a drop-in fallback for json.loads() or as a schema-guided repair step. - Install with pip install json-repair or try the live demo. --- Quick example If json repair saves you time, star the repository so more people can find it. --- Demo If you are unsure whether this library will fix your specific problem, or simply want your JSON validated online, try one of these: - Live demo: https://mangiucugna.github.io/json repair/ - Audio overview: NotebookLM introduction Premium sponsors - Icana-AI Makers of CallCoach, the world's best Call Centre AI Coach. Visit https://www.icana.ai/ - mjharte --- Think about sponsoring this library! This library is free for everyone and is maintained as a side project, so if it helps your work, consider becoming a sponsor: https://github.com/sponsors/mangiucugna --- Motivation Some LLMs are a bit iffy when it comes to returning well formed JSON data, sometimes they skip a parentheses and sometimes they add some words in it, because that's what an LLM does. Luckily, the mistakes LLMs make are simple enough to be fixed without destroying the content. I searched for a lightweight python package that was able to reliably fix this problem but couldn't find any. So I wrote one Supported use cases Fixing Syntax Errors in JSON - Missing quotes, misplaced commas, unesca","default_branch":null,"files":null,"tree":[],"storefront":"/r/mangiucugna","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mangiucugna/json_repair/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}