json-stream
Streaming JSON encoder and decoder
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real problem (memory-efficient JSON streaming) that the standard library does not address. It is production-stable and supports current Python versions. Install it if you regularly work with large JSON files, streaming APIs, or NDJSON formats.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction install with a single native runtime dependency (json-stream-rs-tokenizer).
- Actively maintained with recent commits and stable production status across Python 3.8–3.14.
License · maintenance · safety
permissive license (permissive) — MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.
last release 2026-04-27 (109 days) · last repo commit 2026-04-27 · 190 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,233,796 downloads/mo, #4,180 on PyPI
Alternatives
Verify before relying
import json_stream
# Transient mode (low memory):
with open('large.json') as f:
data = json_stream.load(f)
for item in data['results']:
print(item)
# Persistent mode (full access):
with open('data.json') as f:
data = json_stream.load(f, persistent=True)
print(data['key']) # random access- Performance comparison to standard json.load() on typical file sizes and network streams.
- Behavior and error recovery when encountering truncated or malformed JSON mid-stream.
- Memory overhead of the json-stream-rs-tokenizer native extension vs. pure Python fallback.
What it is and what it does
json-stream is a JSON parser and encoder that processes data incrementally rather than loading entire documents into memory. It provides two primary modes: transient mode for minimal memory footprint (data is discarded after reading), and persistent mode for full random access like the standard library's json module. The package supports streaming from files, URLs, and iterators, and can handle multiple JSON documents in a single stream or JSON mixed with other data.
The package includes a visitor-based interface for depth-first traversal, native code parsing speedups for common platforms via json-stream-rs-tokenizer, and a pure Python fallback. It is designed to reduce memory consumption and latency when processing large or continuously arriving JSON data, making it suitable for applications that cannot afford to buffer entire documents.
Use it for
- Process large JSON files that exceed available memory by streaming them incrementally.
- Parse NDJSON (newline-delimited JSON) or JSON Lines formats from log files or APIs.
- Consume JSON data from HTTP responses without buffering the entire response body.
- Implement visitor-pattern callbacks to extract specific fields from deeply nested JSON structures.
- Mix transient and persistent parsing modes to balance memory usage and random access within a single document.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real problem (memory-efficient JSON streaming) that the standard library does not address. It is production-stable and supports current Python versions. Install it if you regularly work with large JSON files, streaming APIs, or NDJSON formats.
Install
json-stream on PyPI
Before you install
Low friction install with a single native runtime dependency (json-stream-rs-tokenizer). Actively maintained with recent commits and stable production status across Python 3.8–3.14.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.
Quickstart
import json_stream
# Transient mode (low memory):
with open('large.json') as f:
data = json_stream.load(f)
for item in data['results']:
print(item)
# Persistent mode (full access):
with open('data.json') as f:
data = json_stream.load(f, persistent=True)
print(data['key']) # random access
Verify before relying
- Performance comparison to standard json.load() on typical file sizes and network streams.
- Behavior and error recovery when encountering truncated or malformed JSON mid-stream.
- Memory overhead of the json-stream-rs-tokenizer native extension vs. pure Python fallback.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release <4,>=3.5 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagejson-stream-rs-tokenizer |
| Maintenance | Actively maintained 109 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,233,796 / month, #4,180 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries |
Evidence: json_stream-2.5.1-py3-none-any.whl
Tags
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 › “json decoder iterator”
- json-streamStreams JSON data from files, URLs, or iterators without loading the…
- jsonslicerParses JSON streams and large files without loading them entirely…
- simplejsonsimplejson encodes Python objects to JSON and decodes JSON strings…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also json-stream-rs-tokenizer · jsonlines · ndjson · jsonstreams · visitor · nominal-streaming · base64io · crick · jq · streamingjson