skillfed

ndjson

JsonDecoder for ndjson

ndjson v0.3.1 1.7M downloads/30d#3,641 on PyPI69
Copyleft license GNU General Public License v3 Abandoned released

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 ndjson

uv

uv add ndjson

poetry

poetry add ndjson

Installing 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

Development Status :: 2 - Pre-AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: GNU General Public License v3 (GPLv3)Natural Language :: EnglishProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7

Tags

ndjson parserjson lines reader writernewline delimited jsonstreaming jsonndjson file handlingjson encoder decodercsv-like json reader
json-linesstreaming-dataabandoned

More Text Processing packages