jsonslicer
Stream JSON parser with iterator interface
What it is and what it does
JsonSlicer is a streaming JSON parser that reads JSON incrementally from a file or stream without loading the entire document into memory. It uses the YAJL C library for performance and provides a Python iterator interface. You specify a path pattern (using tuples of keys, array indices, or None as wildcards) and the parser yields matching objects as complete Python objects.
The package is designed for processing very large JSON files or continuous streams where memory efficiency matters. It supports multiple path modes to return just the objects, map keys alongside objects, or full path information. It has no runtime dependencies beyond the compiled C extension, making it lightweight once installed.
Use it for:
- Extract specific fields from multi-gigabyte JSON files without loading them into RAM
- Process streaming JSON APIs or log files line-by-line or chunk-by-chunk
- Iterate over all items in a deeply nested array or map using wildcard paths
- Parse JSON with optional features like comments or trailing garbage via YAJL flags
- Recover map keys alongside values when iterating dictionaries in JSON
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses JSON streams and large files without loading them entirely into memory, using a path-based iterator interface to extract specific nested objects.
Yes, if you need to parse large JSON files or streams and your system has YAJL development headers available. The memory efficiency and speed justify the compilation overhead for that use case. No if you work with small JSON documents, prefer pure-Python solutions, or cannot manage C extension builds—the project is abandoned and may have compatibility issues on newer systems.
Install
jsonslicer on PyPI
pip
pip install jsonsliceruv
uv add jsonslicerpoetry
poetry add jsonslicerInstalling jsonslicer
Before you install
High install friction: the package is written in C and depends on the YAJL library, requiring compilation. The project is abandoned (last commit 2022-10-25, 1389 days ago), so build issues on newer systems may not be addressed.
License in practice
MIT license is permissive and poses no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
from jsonslicer import JsonSlicer
with open('data.json') as f:
for item in JsonSlicer(f, ('key', None)):
print(item)
Requires YAJL development library and a C compiler to build the extension module during installation.
Verify before relying
- Whether YAJL development headers are available on target systems without manual installation
- Compatibility with Python versions beyond 3.11 (classifiers list 3.6–3.11 only)
- Current build status on modern compilers and operating systems given the project's abandonment
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,389 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 315,445/month — #7,685 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jsonslicer-0.1.8.tar.gz
Keywords: json, parser, pull, stream
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
ijsonijson is an iterative JSON parser that reads…
permissive · top 1,000 on PyPI
jiterA fast JSON parser that converts bytes into…
permissive · top 1,000 on PyPI
iterable-ioWraps iterables (generators, lists, etc.) as…
copyleft · top 15,000 on PyPI
magicattrProvides nested attribute access and…
permissive · top 5,000 on PyPI
jsonquerylangExecutes queries against JSON data using a…
permissive · top 15,000 on PyPI
json-tools-rsFlattens and unflattens nested JSON structures…
permissive · top 15,000 on PyPI
streamingjsonCompletes partial JSON strings into…
permissive · top 15,000 on PyPI
partialjsonParses incomplete or malformed JSON strings…
permissive · top 15,000 on PyPI
json-numpyProvides lossless JSON encoding and decoding…
permissive · top 15,000 on PyPI
json-source-mapMaps each value in a JSON document to its…
permissive · top 15,000 on PyPI