--- id: partialjson version: "1.1.0" license: MIT license_treatment: permissive maintenance: active --- # partialjson — Parse incomplete or partial json License: permissive · Maintenance: active · Downloads: 596.6K/mo ## What it is and what it does Partialjson is a lightweight Python library for extracting structured data from incomplete or truncated JSON strings—a common problem when parsing streaming responses or interrupted data feeds. It recovers valid Python objects from JSON that is missing closing brackets, trailing commas, or other incomplete syntax, without requiring the full payload to be available upfront. The library offers two parsing modes: strict (default) for standard JSON, and lenient (strict=False) for handling embedded newlines. It also supports JSON5 syntax (comments, unquoted keys, single quotes, trailing commas) when the optional json5 dependency is installed. With zero runtime dependencies in the base package and a simple three-line API, it integrates easily into projects that consume streaming or partially-buffered JSON data. Use it for: - Parse streaming JSON responses from language models or APIs that send data incrementally before the full payload is complete. - Recover structured data from log files or network captures where JSON is truncated or interrupted mid-transmission. - Handle JSON5 configuration files with comments and unquoted keys in development tooling or build systems. - Extract partial results from real-time data pipelines where downstream consumers need to work with incomplete structures. - Debug and inspect malformed JSON payloads during development without manual string repair. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses incomplete or malformed JSON strings into valid Python objects, handling truncated structures and optional JSON5 syntax extensions. Yes. The package solves a real problem—parsing incomplete JSON—with minimal overhead and no dependencies. Active maintenance, permissive MIT license, and a clean API make it a low-risk addition to projects that consume streaming or interrupted JSON data. Not needed for standard, complete JSON parsing. ## Install pip install partialjson uv add partialjson poetry add partialjson ## Installing partialjson Before you install: Low friction—pure Python wheel with no runtime dependencies. Active maintenance with recent commits and a modest but steady user base. License in practice: MIT license permits unrestricted use, modification, and distribution in both open and proprietary projects. Quickstart: from partialjson import JSONParser parser = JSONParser() incomplete_json = '{"name": "John", "age": 30, "items": [1, 2' result = parser.parse(incomplete_json) print(result) # {'name': 'John', 'age': 30, 'items': [1, 2]} Verify before relying: - Whether strict=False mode handles all edge cases with embedded newlines reliably - Performance characteristics on very large incomplete JSON payloads - Exact JSON5 feature coverage when json5 optional dependency is installed ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 596.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags parse incomplete json, partial json parser, truncated json handling, json parsing with missing brackets, streaming json parser, json5 support, malformed json recovery, json-parsing, streaming-data, error-recovery [View on SkillFed](https://skillfed.io/packages/partialjson) · [View on PyPI](https://pypi.org/project/partialjson/)