ndjson
JsonDecoder for ndjson
What it is and what it does
ndjson is a lightweight, dependency-free library for reading and writing JSON Lines (newline-delimited JSON) files. It mirrors the familiar interface of Python's built-in json and pickle modules, offering both high-level functions (load, loads, dump, dumps) and lower-level streaming classes (reader, writer, JSONEncoder, JSONDecoder) for flexible integration with other libraries like requests.
The package is small, has no external dependencies, and includes tests. However, it has been abandoned since early 2020 with no active maintenance, so it will not receive bug fixes or updates for compatibility with newer Python versions or JSON specifications.
Use it for:
- Parse streaming JSON Lines data from APIs or log files without loading entire datasets into memory
- Convert between ndjson text format and Python objects using a json-like interface
- Integrate ndjson parsing into requests-based HTTP clients via the JSONDecoder class
- Write Python objects to ndjson files with csv-like reader/writer classes for batch processing
- Handle newline-delimited JSON in data pipelines where each line is a separate JSON object
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a familiar JSON Lines (ndjson) parser and writer with an API matching Python's built-in json and pickle modules, supporting streaming and file I/O for newline-delimited JSON data.
Yes, if you need ndjson support in a stable, mature codebase targeting Python 2.7 or 3.5–3.7 and do not require ongoing maintenance. The package is simple, dependency-free, and has no known vulnerabilities. No, if you require active maintenance, support for modern Python versions, or need assurance of future compatibility—consider alternatives or vendor the code directly.
Install
ndjson on PyPI
pip
pip install ndjsonuv
uv add ndjsonpoetry
poetry add ndjsonInstalling ndjson
Before you install
No runtime dependencies and a pure-Python wheel make installation frictionless. However, the package is abandoned—last release was 2020-02-25 and last commit 2022-12-26—so no maintenance or security updates should be expected.
License in practice
Licensed under GNU General Public License v3 (copyleft). Any derivative work or modification must be distributed under the same license; proprietary or closed-source projects should review compatibility before use.
Quickstart
import ndjson
# Load from file
with open('data.ndjson') as f:
data = ndjson.load(f)
# Convert to/from text
text = ndjson.dumps(data)
data = ndjson.loads(text)
Verify before relying
- Whether the package works reliably with modern Python versions (classifiers list only up to 3.7; requires_python is unspecified)
- Whether there are known incompatibilities or edge cases in ndjson parsing that the fact sheet does not surface
Package facts
| License | GNU General Public License v3 (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,362 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,702,710/month — #3,641 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ndjson-0.3.1-py2.py3-none-any.whl
Keywords: ndjson
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
edn-formatReads and writes EDN (Extensible Data Notation)…
permissive · top 5,000 on PyPI
jsonlinesSimplifies reading and writing jsonlines…
permissive · top 5,000 on PyPI
jsonstreamsWrites JSON documents in a streaming format…
permissive · top 15,000 on PyPI
json-streamStreams JSON data from files, URLs, or…
permissive · top 5,000 on PyPI
json5Parses and writes JSON5 data format, which…
permissive · top 1,000 on PyPI
numpyencoderProvides a custom JSON encoder class that…
permissive · top 15,000 on PyPI
file-read-backwardsReads files line-by-line from end to beginning…
permissive · top 15,000 on PyPI
jsonconversionConverts arbitrary Python objects to JSON…
permissive · top 5,000 on PyPI
ijsonijson is an iterative JSON parser that reads…
permissive · top 1,000 on PyPI
dirtyjsonParses JSON-like data from files containing…
permissive · top 5,000 on PyPI