zstd
ZSTD Bindings for Python
What it is and what it does
Zstd is a Python wrapper around Yann Collet's Zstandard compression library, a modern lossless compression algorithm that balances compression ratio and speed for everyday use. It sits between extremes like LZMA (highest ratio) and LZ4 (extreme speed), making it suitable for general-purpose compression tasks.
The package provides simple, direct bindings to compress and decompress data. It has no runtime dependencies and works across Python 2.7 and modern Python 3 versions (3.4 through 3.14) on multiple platforms. Building from source requires libzstd development files and a C99-capable compiler; prebuilt wheels are available for most common configurations. The package is intentionally kept simple—dictionary and streaming support are not planned.
Use it for:
- Compress data for storage or transmission when you need better speed than LZMA but better ratio than LZ4.
- Replace gzip or bzip2 compression in existing pipelines where Zstd's performance profile is beneficial.
- Compress Python objects or serialized data in applications requiring fast, standard-compatible compression.
- Build tools or utilities that need lossless compression without external command-line dependencies.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python bindings to the Zstandard (Zstd) compression library, enabling compression and decompression of data using the Zstd algorithm.
Yes, if you need Zstd compression in Python and can meet the build dependencies (libzstd 1.4.0+, C99 compiler). The package is actively maintained, has no known vulnerabilities, and prebuilt wheels cover most platforms. No if you require streaming or dictionary support—the description explicitly notes these are not planned.
Install
zstd on PyPI
pip
pip install zstduv
uv add zstdpoetry
poetry add zstdInstalling zstd
Before you install
Medium install friction due to compiled C extension requiring libzstd development files (version 1.4.0 or later) and a C99-capable compiler. Repository is actively maintained with recent commits, though the last release was 417 days ago.
License in practice
BSD license (permissive) places no significant restrictions on use, modification, or distribution in most contexts.
Quickstart
import zstd
data = b'hello world'
compressed = zstd.compress(data)
decompressed = zstd.decompress(compressed)
Requires libzstd development files (version 1.4.0+) and a C99-capable compiler (gcc >= 4.8) to build from source; prebuilt wheels available for many Python versions and platforms.
Verify before relying
- Whether prebuilt wheels are available for your specific Python version and platform combination.
- Performance characteristics compared to alternative compression libraries in your use case.
- Current state of dictionary and streaming support, as the description notes these are not planned but may have changed.
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 417 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 9,461,676/month — #1,532 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: zstd-1.5.7.2-cp27-cp27m-macosx_10_9_x86_64.whl; zstd-1.5.7.2-cp27-cp27m-manylinux1_i686.whl; zstd-1.5.7.2-cp27-cp27m-manylinux1_x86_64.whl; zstd-1.5.7.2-cp27-cp27mu-manylinux1_i686.whl; zstd-1.5.7.2-cp27-cp27mu-manylinux1_x86_64.whl; zstd-1.5.7.2-cp27-cp27mu-manylinux_2_4_i686.whl; zstd-1.5.7.2-cp27-cp27mu-manylinux_2_4_x86_64.whl; zstd-1.5.7.2-cp310-cp310-macosx_10_9_x86_64.whl; zstd-1.5.7.2-cp310-cp310-macosx_11_0_arm64.whl; zstd-1.5.7.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl; zstd-1.5.7.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl; zstd-1.5.7.2-cp310-cp310-manylinux_2_4_i686.whl; zstd-1.5.7.2-cp310-cp310-manylinux_2_4_x86_64.whl; zstd-1.5.7.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl; zstd-1.5.7.2-cp310-cp310-musllinux_1_2_aarch64.whl; zstd-1.5.7.2-cp310-cp310-musllinux_1_2_i686.whl; zstd-1.5.7.2-cp310-cp310-musllinux_1_2_x86_64.whl; zstd-1.5.7.2-cp310-cp310-win32.whl; zstd-1.5.7.2-cp310-cp310-win_amd64.whl; zstd-1.5.7.2-cp311-cp311-macosx_10_9_x86_64.whl
Keywords: zstd, zstandard, compression
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pyvista-zstdCompress and decompress VTK datasets using…
permissive · top 15,000 on PyPI
pyzstdProvides Python bindings to the Zstandard…
permissive · top 5,000 on PyPI
zstandardProvides Python bindings to the Zstandard…
permissive · top 1,000 on PyPI
zipfile-zstdExtends Python's standard zipfile module to…
permissive · top 5,000 on PyPI
backports.zstdProvides Zstandard compression support for…
permissive · top 1,000 on PyPI
pybcjpybcj provides Python bindings to a BCJ…
copyleft · top 5,000 on PyPI
xpress8xpress8 provides Python bindings to Microsoft's…
permissive · top 15,000 on PyPI
types-zstdProvides type hints for the zstd compression…
permissive · top 15,000 on PyPI
fastarFastar provides high-performance tar archive…
permissive · top 1,000 on PyPI
hdf5pluginRegisters HDF5 compression filters (Blosc,…
unclear · top 15,000 on PyPI