skillfed

json-repair

A package to repair broken json strings

json-repair Permissive license MIT Active 5,070 v0.63.1 released

Install

json-repair on PyPI

pip

pip install json-repair

uv

uv add json-repair

poetry

poetry add json-repair

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 1 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: json_repair-0.63.1-py3-none-any.whl

Keywords: JSON, REPAIR, LLM, PARSER

Operating System :: OS IndependentProgramming Language :: Python :: 3

About json-repair

from the package's own PyPI description — quoted content, verbatim

PyPI (image) Python version (image) PyPI downloads (image) PyPI Downloads (image) Github Sponsors (image) GitHub Repo stars (image)

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.

banner (image)


Quick...

Read as markdown · JSON record · Source repository · Homepage

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

Parses and repairs malformed JSON from LLMs, APIs, and user input by fixing missing quotes, commas, brackets, and other syntax errors, then returns valid JSON or Python objects.

Installs with zero runtime dependencies and requires only Python 3.10+. Actively maintained with a recent release and strong community engagement (5070 stars), making it a low-friction addition to any project.

MIT license permits unrestricted use, modification, and distribution in both open and closed-source projects with only attribution required.

Usage

pip install json-repair

import json_repair

bad_json = '{"users":[{"name":"Ada"}],"ok":true'
result = json_repair.loads(bad_json)
# Returns: {'users': [{'name': 'Ada'}], 'ok': True}

Requires Python 3.10 or later.

Verdict: A well-maintained, dependency-free utility for handling real-world malformed JSON—particularly useful when integrating LLM outputs. MIT-licensed, actively developed, and ranked in the top 1000 PyPI packages with no known vulnerabilities. Straightforward to adopt as a drop-in replacement for json.loads().

Needs verification

  • Whether the repair heuristics preserve semantic intent for all classes of malformed input (e.g., truncated values, stray prose insertion patterns).
  • Performance characteristics when processing very large or deeply nested JSON structures.
fix broken jsonjson repair parserllm json validationmalformed json fixerjson syntax error recoveryincomplete json parsingjson fallback handler

Similar packages