skillfed

fix-busted-json

Fixes broken JSON string objects

fix-busted-json v0.0.19 100.7K downloads/30d#12,976 on PyPI
Permissive license AGING released

What it is and what it does

fix-busted-json is a Python utility that takes JSON strings with common syntax violations and returns valid JSON. It handles unquoted keys, incorrect quote styles (single quotes, backticks, curly quotes), missing commas, trailing commas, Python literals (True/False/None), string concatenation, and various escaping edge cases. The package also provides helper functions to locate and extract JSON objects embedded within plain text—a use case that emerged from processing large language model outputs, which often produce JSON-like structures with syntax errors.

The package has no runtime dependencies and supports Python 3.6 and later. It is designed as a lightweight, focused tool for a specific problem: when you have text containing JSON that is almost valid but has known categories of errors, fix-busted-json can normalize it into parseable form without requiring manual intervention or complex error handling.

Use it for:

  • Extract and repair JSON output from large language model completions that contain syntax errors
  • Parse JSON-like objects embedded in log files or unstructured text with quote and comma issues
  • Normalize malformed JSON responses from APIs or third-party tools before processing
  • Find and pretty-print all JSON objects within a larger text document, including nested objects
  • Convert Python dict-like syntax (with True/False/None) into valid JSON for downstream processing

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

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.

Yes, if you regularly encounter malformed JSON from LLMs or need to extract JSON from unstructured text. The package is lightweight, dependency-free, and handles a well-defined set of real-world syntax errors. The aging maintenance status is not a blocker for a focused utility with no external dependencies and no known vulnerabilities, but do not expect active development or rapid response to new issues.

Install

fix-busted-json on PyPI

pip

pip install fix-busted-json

uv

uv add fix-busted-json

poetry

poetry add fix-busted-json

Installing fix-busted-json

Before you install

Low install friction with no runtime dependencies. Maintenance status is aging (208 days since last release), though the package was last released 2026-01-18.

License in practice

MIT license (permissive) allows free use, modification, and distribution with minimal restrictions.

Quickstart

pip install fix-busted-json

from fix_busted_json import repair_json

invalid_json = "{ name: 'John' 'age': 30, 'city': 'New' + ' York', }"
fixed_json = repair_json(invalid_json)
print(fixed_json)

Requires Python 3.6 or later.

Verify before relying

  • Whether the repair heuristics handle all edge cases reliably or fail gracefully on deeply nested or unusual malformed JSON
  • Performance characteristics on very large JSON strings or documents with many embedded objects

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 208 days since the last release
First released
Downloads 100,668/month — #12,976 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fix_busted_json-0.0.19-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

fix broken jsonrepair invalid jsonjson syntax fixerextract json from textparse malformed jsonjson error correctionllm json output repair
json-repairllm-outputtext-extraction

More Text Processing packages