jsonstreams
A JSON streaming writer
What it is and what it does
jsonstreams is a JSON writer that lets you build and output JSON documents incrementally without loading the entire structure into memory first. Instead of constructing nested dicts and lists and then serializing them with the standard json module, you write key-value pairs and nested structures directly to a file or stream using a context-manager interface. This is useful when generating large JSON files or when data arrives incrementally.
The package treats JSON arrays and objects as first-class streaming containers, mirroring Python's list and dict semantics. It supports any type that the standard json.JSONEncoder can handle, or you can subclass the encoder for custom types. The context-manager design ensures containers are properly closed; writing to a closed container raises an exception to catch programming errors early.
Use it for:
- Generate large JSON files without loading all data into memory at once
- Stream JSON output from a database query or API response incrementally
- Build JSON documents where data arrives in chunks or from multiple sources
- Write JSON logs or metrics where each entry is added one at a time
- Reduce peak memory usage in data processing pipelines that produce JSON
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Writes JSON documents in a streaming format without building the entire data structure in memory first, using a context-manager-based interface for arrays and objects.
Yes, if you need to write large JSON files or stream JSON output incrementally and want to avoid building the full data structure in memory. The low install friction and permissive license make it a safe choice. However, the dormant maintenance status (last release 2021-03-16) means no active support; use it only for stable, straightforward JSON streaming tasks where you don't expect ongoing development.
Install
jsonstreams on PyPI
pip
pip install jsonstreamsuv
uv add jsonstreamspoetry
poetry add jsonstreamsInstalling jsonstreams
Before you install
Low install friction with only two runtime dependencies (six and enum34). Maintenance is dormant—last release was 2021-03-16 and no commits since 2024-05-15—so expect no active bug fixes or feature work, though the package remains stable for its stated use case.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
import jsonstreams
with jsonstreams.Stream(jsonstreams.Type.OBJECT, filename='foo') as s:
s.write('foo', 'bar')
with s.subobject('a') as a:
a.write('foo', 1)
a.write('bar', 2)
Verify before relying
- Performance characteristics compared to standard json module for typical workloads
- Compatibility with Python 3.10+ (classifiers only list up to 3.9)
- Whether enum34 dependency is still required on Python 3.4+
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — six, enum34 |
| Maintenance | dormant — 1,977 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 169,603/month — #10,414 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jsonstreams-0.6.0-py2.py3-none-any.whl
Keywords: JSON, stream
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
ndjsonProvides a familiar JSON Lines (ndjson) parser…
copyleft · top 5,000 on PyPI
jsonlinesSimplifies reading and writing jsonlines…
permissive · top 5,000 on PyPI
json-streamStreams JSON data from files, URLs, or…
permissive · top 5,000 on PyPI
numpyencoderProvides a custom JSON encoder class that…
permissive · top 15,000 on PyPI
standardjsonProvides a JSON encoder that handles datetime,…
permissive · top 15,000 on PyPI
compact-jsonFormats JSON into compact, human-readable…
permissive · top 5,000 on PyPI
stream-zipConstructs ZIP archives on-the-fly without…
permissive · top 15,000 on PyPI
json-numpyProvides lossless JSON encoding and decoding…
permissive · top 15,000 on PyPI
writer-sdkPython client library for the Writer REST API,…
permissive · top 15,000 on PyPI
json-tricksExtends Python's JSON serialization to handle…
permissive · top 15,000 on PyPI