High-performance JSON/NDJSON compression library
Project description
jzpack
High-compression JSON library using columnar storage + zstd.
Installation
pip install jzpack
Quick Start
from jzpack import compress, decompress
data = [{"service": "api", "status": "ok", "latency": 42} for _ in range(10000)]
compressed = compress(data)
original = decompress(compressed)
Benchmarks
100K records, zstd level 3, 3 iterations averaged.
Realistic Data (mixed repetition):
| Strategy | Size | Ratio | Compress | Decompress |
|---|---|---|---|---|
| json + gzip | 5.71 MB | 3.45x | 14 MB/s | 91 MB/s |
| orjson + zstd | 5.86 MB | 3.36x | 220 MB/s | 143 MB/s |
| msgpack + zstd | 5.71 MB | 3.44x | 154 MB/s | 125 MB/s |
| jzpack | 4.60 MB | 4.28x | 48 MB/s | 53 MB/s |
High Cardinality (worst case, unique values):
| Strategy | Size | Ratio | Compress | Decompress |
|---|---|---|---|---|
| json + gzip | 19.94 MB | 1.78x | 14 MB/s | 102 MB/s |
| orjson + zstd | 19.61 MB | 1.81x | 159 MB/s | 166 MB/s |
| msgpack + zstd | 19.04 MB | 1.87x | 147 MB/s | 175 MB/s |
| jzpack | 15.86 MB | 2.24x | 75 MB/s | 79 MB/s |
vs msgpack+zstd (same underlying compression): 17-19% smaller, 2-3x slower.
Run: python benchmark.py
When to Use
Cold storage, archival, network transfer
Datasets with field repetition
API
from jzpack import compress, decompress, JZPackCompressor, StreamingCompressor
compress(data, level=3) -> bytes
decompress(data) -> list[dict]
compressor = JZPackCompressor(compression_level=3)
compressor.compress(data) -> bytes
compressor.decompress(data) -> list[dict]
compressor.compress_to_file(data, "out.jzpk")
compressor.decompress_from_file("out.jzpk") -> list[dict]
stream = StreamingCompressor(compression_level=3)
stream.add_record(record)
stream.add_batch(records)
stream.finalize() -> bytes
stream.clear()
How It Works
- Schema grouping — records grouped by structure
- Columnar storage — fields stored as columns
- Smart encoding — RLE, Delta, Dictionary per column
- MessagePack + Zstandard — binary serialization + compression
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jzpack-0.1.2.tar.gz.
File metadata
- Download URL: jzpack-0.1.2.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a18ce4abff13fba2d8b4bb3332b23aea4afc8510c906d789c597703ee2e13c05
|
|
| MD5 |
dd514abb5f8ee88d4ead0743fbe525be
|
|
| BLAKE2b-256 |
56a4963ecb6981758305402fe3cbfa106fb1a21b09d76adb28e964de0b48a260
|
Provenance
The following attestation bundles were made for jzpack-0.1.2.tar.gz:
Publisher:
python-publish.yml on hasanzaibak/jzpack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jzpack-0.1.2.tar.gz -
Subject digest:
a18ce4abff13fba2d8b4bb3332b23aea4afc8510c906d789c597703ee2e13c05 - Sigstore transparency entry: 780823333
- Sigstore integration time:
-
Permalink:
hasanzaibak/jzpack@57d30277465172d8c128d23cc36e3df9f4c42ce7 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/hasanzaibak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@57d30277465172d8c128d23cc36e3df9f4c42ce7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file jzpack-0.1.2-py3-none-any.whl.
File metadata
- Download URL: jzpack-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ed9f13a874150066ecdc6155b05895c3bb03918df41d664fe31da43dd4f55f9
|
|
| MD5 |
53ef25b11b77882f73083ba0d92ed79b
|
|
| BLAKE2b-256 |
3a6e413c6484211b1372148a76602f145a8ec6c214cf9143c8f04060bc3295c3
|
Provenance
The following attestation bundles were made for jzpack-0.1.2-py3-none-any.whl:
Publisher:
python-publish.yml on hasanzaibak/jzpack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jzpack-0.1.2-py3-none-any.whl -
Subject digest:
3ed9f13a874150066ecdc6155b05895c3bb03918df41d664fe31da43dd4f55f9 - Sigstore transparency entry: 780823334
- Sigstore integration time:
-
Permalink:
hasanzaibak/jzpack@57d30277465172d8c128d23cc36e3df9f4c42ce7 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/hasanzaibak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@57d30277465172d8c128d23cc36e3df9f4c42ce7 -
Trigger Event:
release
-
Statement type: