$npx skillfedfor your agent

json-repair

A package to repair broken json strings

Worth itPyPI Released Aug 202638.1M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — json_repair-0.63.1-py3-none-any.whl
v0.63.1 · released 2026-08-12 · Python >=3.10

Yes. The package solves a real problem with zero runtime dependencies, active maintenance, no known vulnerabilities, and a permissive MIT license. It is most valuable if you regularly consume JSON from LLMs, APIs, or user input where malformation is expected. If your JSON always comes from trusted, well-formed sources, the overhead is unnecessary—use standard json.loads() instead.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later.
  • No runtime dependencies and a pure Python wheel distribution make installation straightforward.
  • The package is actively maintained with a recent release and no known vulnerabilities.

License · maintenance · safety

MIT (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.

last release 2026-08-12 (2 days) · last repo commit 2026-08-12 · 5,071 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 38,109,958 downloads/mo, #716 on PyPI

Verify before relying

pip install json-repair

import json_repair

bad_json = '{"users":[{"name":"Ada","role":"admin",}],"ok":true'
decoded_object = json_repair.loads(bad_json)
# Returns: {'users': [{'name': 'Ada', 'role': 'admin'}], 'ok': True}
  • Extent of JSON corruption that the repair parser can successfully handle before returning empty string or raising an error.
  • Performance characteristics when processing very large malformed JSON documents.
  • Whether the repair heuristics preserve semantic intent in ambiguous cases (e.g., when multiple valid repairs are possible).
Same gist for agents: .md · .json

What it is and what it does

json-repair is a lightweight Python library that attempts to parse and fix malformed JSON strings that would normally fail standard JSON parsing. It handles common LLM output errors like missing quotes, trailing commas, unmatched brackets, and stray text by applying repair heuristics to restore valid JSON structure. The library works as a drop-in replacement for json.loads() and json.load(), automatically trying strict parsing first and falling back to repair logic only when needed.

The package is designed for scenarios where JSON comes from untrusted or imperfect sources—LLM responses, user input, log files, or API responses that may be truncated or malformed. It supports auto-completion of missing values with defaults, handles Python-style tuples, recognizes case-insensitive boolean and null values, and can preserve non-Latin characters when configured. For performance-critical paths where you know input is already invalid, it offers a skip_json_loads flag to bypass the initial validation step.

Use it for

  • Parse JSON responses from large language models that occasionally omit closing brackets or add stray text.
  • Recover structured data from incomplete API responses or truncated log entries without manual preprocessing.
  • Handle user-submitted JSON that may contain syntax errors or non-standard formatting.
  • Validate and repair JSON from external sources before passing to downstream processing.
  • Fallback layer in applications that need to extract data even when input is partially corrupted.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

The package solves a real problem with zero runtime dependencies, active maintenance, no known vulnerabilities, and a permissive MIT license. It is most valuable if you regularly consume JSON from LLMs, APIs, or user input where malformation is expected. If your JSON always comes from trusted, well-formed sources, the overhead is unnecessary—use standard json.loads() instead.

Install

json-repair on PyPI

Before you install

No runtime dependencies and a pure Python wheel distribution make installation straightforward. The package is actively maintained with a recent release and no known vulnerabilities.

Requires Python 3.10 or later.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.

Quickstart

pip install json-repair

import json_repair

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

Verify before relying

  • Extent of JSON corruption that the repair parser can successfully handle before returning empty string or raising an error.
  • Performance characteristics when processing very large malformed JSON documents.
  • Whether the repair heuristics preserve semantic intent in ambiguous cases (e.g., when multiple valid repairs are possible).

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 2 days since the last release
Last repo commit
First released
Downloads38,109,958 / month, #716 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Operating System :: OS IndependentProgramming Language :: Python :: 3

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

Tags

Capabilities
fix broken jsonjson repair llm outputmalformed json parserjson syntax error fixjson validation and repairincomplete json recoveryjson error correction
Topics
json-parsingllm-integrationerror-recovery
PyPI keywords
JSONREPAIRLLMPARSER

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “fix broken json”

  • json-repairParses and repairs malformed JSON strings from LLMs, APIs, logs, and…
  • fix-busted-jsonRepairs malformed JSON strings by fixing common syntax errors like…
  • mkdocs-redirectsA MkDocs plugin that generates HTTP redirects for moved or renamed…

Give your agent the search over MCP, or paste the wish link into any chat.

Similar packages

fix-busted-json With conditions
PyPI · Text Processing · released Jan 2026

Repairs malformed JSON strings by fixing common syntax errors like unquoted keys, wrong quote types, missing commas, and Python literal values, then optionally extracts JSON objects from surrounding text.

MITpure Python · 3.6+aging
100.7Kdownloads / mo
partial-json-parser Worth it
PyPI · Text Processing · released Nov 2025

Parses incomplete JSON strings generated by LLM streaming, extracting usable data before the full response arrives, and can complete partial JSON to valid syntax.

permissive licensepure Python · 3.6+
6.4Mdownloads / mo
json-with-comments Worth it
PyPI · Python Modules · released Dec 2024

Parses and serializes JSON with support for single-line and block comments, plus trailing commas in arrays and objects.

Install it if you need to parse or generate JSON with comments.

MITpure Python · 3.7+
136.9Kdownloads / mo
jsoncomment Skip
PyPI · Text Editors · released Feb 2019

Parses JSON with comments, multiline strings, and trailing commas by preprocessing input before passing it to any standard JSON parser.

MITpure Python · 3.3+abandoned
136.1Kdownloads / mo
partialjson Worth it
PyPI · Text Processing · released Feb 2026

Parses incomplete or malformed JSON strings into valid Python objects, handling truncated structures and optional JSON5 syntax extensions.

permissive licensepure Python
596.6Kdownloads / mo
json-tricks Worth it
PyPI · Python Modules · released Aug 2023

Extends Python's JSON serialization to handle numpy arrays, class instances, datetimes, OrderedDict, comments, and other non-standard types while preserving human readability.

Install it if you need to serialize non-standard Python types to JSON; skip it if you only work with standard JSON types.

BSD-3-Clausepure Python
205.0Kdownloads / mo

See also json-five · json-numpy · json5kit