Open Source PackageLive
jsonrepair-lite
Lightweight Python package to auto-repair broken JSON from LLMs and APIs.
Overview
Pure Python JSON repair library for pip. Handles markdown fences, JS comments, single quotes, Python literals, trailing commas, unquoted keys, missing commas, truncated strings, unclosed brackets, NaN/Infinity, and extracts JSON from surrounding text. Zero dependencies, Python 3.8+.
Features
- Strip markdown code fences
- Remove JS-style comments
- Fix Python literals (True/False/None)
- Repair truncated strings & brackets
- Handle NaN and Infinity values
- Extract JSON from surrounding text