skillfed

streamingjson

A streamlined, user-friendly JSON streaming preprocessor, crafted in Python.

streamingjson v0.0.5 788.0K downloads/30d#5,058 on PyPI114
Permissive license DORMANT released

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 on this page — 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

streamingjson on PyPI

pip

pip install streamingjson

uv

uv add streamingjson

poetry

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 the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 693 days since the last release
Last repo commit
First released
Downloads 787,992/month — #5,058 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: streamingjson-0.0.5-py3-none-any.whl

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

Tags

incomplete json completionstreaming json parserpartial json validationjson stream preprocessingllm json output handlingincomplete json repairjson fragment completion
streamingjson-parsingllm-integration

More Text Processing packages