Registry / serialization / zstandard

zstandard

JSON →
library0.25.0pypypi✓ verified 24d ago

Python bindings for the Zstandard compression library, providing high compression ratios and fast decompression speeds. Current version: 0.25.0. Released on a regular basis with active maintenance.

pip install zstandard
INSTALL
IMPORT
SIG · ZSTANDARD
Z
zstandard
serializationpythonv0.25.0
Install
2.0s avg
Import
20ms
Disk
35MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.25.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.016s · 32.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.0s · import 0.016s · 41MB
35MB installed
● package 35MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ZstdCompressor
from zstandard import ZstdCompressor
Ensure correct import path to access ZstdCompressor class

Basic usage example demonstrating compression and decompression with zstandard.

import zstandard # Compress data compressor = zstandard.ZstdCompressor() compressed_data = compressor.compress(b'Hello, world!') # Decompress data decompressor = zstandard.ZstdDecompressor() decompressed_data = decompressor.decompress(compressed_data) print(decompressed_data.decode()) # Outputs: Hello, world!
Debug
Known issues
breakingSupport for Python 3.8 has been dropped; Python 3.9 is now the minimum supported version.
fix
Upgrade to Python 3.9 or later.
affects: 0.24.0
deprecatedThe 'manylinux2010' wheel format is no longer supported; consider using 'manylinux2014' or 'manylinux2010' wheels.
fix
Update wheel distribution to 'manylinux2014' or 'manylinux2010'.
affects: 0.22.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'zstandard'
The `zstandard` package is not installed in the current Python environment or is not accessible on the Python path.
fix
pip install zstandard
ERROR: Could not build wheels for zstandard
The system lacks necessary C/C++ build tools (like a compiler) required to compile the `zstandard` C extensions from source.
fix
Install the appropriate build tools for your operating system (e.g., `build-essential` on Debian/Ubuntu, Xcode command line tools on macOS, or Visual C++ build tools on Windows) before running `pip install zstandard`.
zstandard.ZstdError: Decompression error: Frame content corrupted
The input data is corrupted, incomplete, or not a valid Zstandard frame, preventing successful decompression.
fix
Verify the integrity and completeness of the compressed input data. Ensure that the data was indeed compressed using Zstandard and that any required dictionaries are correctly applied during decompression.
AttributeError: module 'zstandard' has no attribute 'compress'
The `zstandard` module does not expose top-level `compress` or `decompress` functions directly; these operations are performed via instances of `ZstdCompressor` or `ZstdDecompressor`.
fix
Create an instance of the `ZstdCompressor` or `ZstdDecompressor` class to perform compression/decompression, e.g., `cctx = zstandard.ZstdCompressor(); compressed_data = cctx.compress(data)`.
Upgrade
Version history
0.25.0latest on PyPI · released Sep 14, 2025
Audit
Dependencies
cffirequiredRequired for C extensions in zstandard
Agent activity
48 hits · last 30 days
node
42
OpenAI (training)
1
Resources
zstandard — pip install zstandard · libregistry