--- id: streamingjson version: "0.0.5" license: unclear license_treatment: permissive maintenance: dormant --- # streamingjson — A streamlined, user-friendly JSON streaming preprocessor, crafted in Python. License: permissive · Maintenance: dormant · Downloads: 788.0K/mo ## What it is and what it does streamingjson is a JSON preprocessing library that transforms incomplete or fragmented JSON strings into valid, parseable JSON by intelligently closing open structures and filling missing values. It is designed for scenarios where JSON is generated incrementally—particularly from LLM outputs—and needs to be parsed before the full response is available. The library maintains a lexer state across multiple append operations, allowing you to feed JSON fragments one piece at a time and request a completed, valid JSON string at any point. The primary use case is reducing latency in streaming applications: instead of waiting for a complete JSON response, you can parse and display partial results immediately. The library handles edge cases like incomplete Unicode escapes, trailing commas, and mid-value stream interruptions by completing them to valid JSON. It has no external dependencies and installs as a pure Python wheel, making it lightweight and easy to integrate into existing projects. Use it for: - Display LLM-generated JSON responses to users in real-time without waiting for the full output to complete. - Preprocess incomplete JSON from streaming APIs before passing to standard json library for parsing. - Build chat interfaces that show structured data (tables, lists) as it arrives from a language model. - Handle JSON fragments from network streams that may be interrupted or arrive out of order. - Validate and complete partial JSON configuration or data files during incremental loading. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Completes partial JSON strings into syntactically valid JSON by inferring missing closing brackets, braces, and values, enabling real-time parsing of incomplete JSON streams. Yes, if you are building a streaming application that consumes JSON from LLMs or other incremental sources and need to parse partial results. The library is lightweight, has no dependencies, and solves a specific real problem. However, maintenance is dormant (last release 693 days ago), so evaluate whether you are comfortable adopting a package that may not receive updates. No known vulnerabilities. ## Install pip install streamingjson uv add streamingjson poetry add streamingjson ## Installing streamingjson Before you install: Low friction: pure Python wheel with no runtime dependencies. Maintenance is dormant—last release was 693 days ago, though the repository remains active with 114 stars and a recent commit in September 2024. License in practice: MIT license (permissive) imposes no restrictions on use, modification, or distribution in commercial or private projects. Quickstart: pip install streamingjson import streamingjson lexer = streamingjson.Lexer() lexer.append_string('{"a":') print(lexer.complete_json()) # outputs: {"a":null} Requires Python 3.7 or later. Verify before relying: - Whether the library handles all JSON edge cases (nested structures, escaped characters, Unicode) correctly in production scenarios. - Performance characteristics when processing very large or deeply nested JSON streams. - Compatibility with popular JSON libraries (json, ujson, orjson) when used as a preprocessor. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 788.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags incomplete json completion, streaming json parser, partial json validation, json stream preprocessing, llm json output handling, incomplete json repair, json fragment completion, streaming, json-parsing, llm-integration [View on SkillFed](https://skillfed.io/packages/streamingjson) · [View on PyPI](https://pypi.org/project/streamingjson/)