pyzstd
Support for Zstandard (zstd) compression
What it is and what it does
pyzstd is a Python wrapper around the Zstandard compression library that mirrors the API of Python's built-in compression modules (bz2, lzma, zlib). It compresses and decompresses data using the zstd format, which offers fast compression with good compression ratios. Since version 0.19.0, it internally uses Python's native compression.zstd module when available.
The package is now primarily a compatibility shim for projects that need zstd support on Python 3.10+. The maintainers recommend that new projects use Python's standard library compression.zstd directly, and existing projects consider migrating. It remains actively maintained and carries no known security vulnerabilities.
Use it for:
- Compress and decompress data in zstd format on Python 3.10+ where native support is available
- Migrate legacy code from pyzstd to the standard library compression.zstd module
- Work with seekable zstd streams or tar archives in zst format
- Maintain compatibility with code written against the pyzstd API
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python bindings to the Zstandard (zstd) compression library with an API similar to bz2, lzma, and zlib modules.
No for new projects—use Python's native compression.zstd module instead. Yes-with-conditions for existing codebases already using pyzstd that need to stay on Python 3.10+; the package is stable and actively maintained but the maintainers explicitly recommend migration to the standard library.
Install
pyzstd on PyPI
pip
pip install pyzstduv
uv add pyzstdpoetry
poetry add pyzstdInstalling pyzstd
Before you install
Low install friction with a pure-wheel distribution. Actively maintained with recent commits and production-stable status. Internally delegates to Python's native compression.zstd since version 0.19.0, making it a compatibility layer for older Python versions.
License in practice
BSD-3-Clause permissive license allows unrestricted commercial and private use with minimal obligations—suitable for most projects.
Quickstart
pip install pyzstd
import pyzstd
compressed = pyzstd.compress(b'data')
original = pyzstd.decompress(compressed)
Requires Python 3.10 or later; for older Python versions, the package recommends using backports.zstd instead.
Verify before relying
- Whether pyzstd offers performance advantages over direct use of compression.zstd in Python 3.10+
- Specific seekable stream or tar-related functionality beyond standard compress/decompress
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — backports-zstd, typing-extensions |
| Maintenance | actively maintained — 244 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,519,496/month — #1,612 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyzstd-0.19.1-py3-none-any.whl
Keywords: compress, decompress, file, seek, seekable, tar, zst, zstandard, zstd
Tags
More Compression packages
Provides Python bindings to the Brotli…
permissive · top 1,000 on PyPI
backports.zstdProvides Zstandard compression support for…
permissive · top 1,000 on PyPI
zopfliZopfli is a Python binding for Google's Zopfli…
permissive · top 1,000 on PyPI
python-snappyPython binding for Google's Snappy compression…
permissive · top 5,000 on PyPI
pyzipperpyzipper replaces Python's standard zipfile…
permissive · top 5,000 on PyPI
compressed-rtfCompresses and decompresses Rich Text Format…
permissive · top 5,000 on PyPI
lz4Python bindings for the LZ4 compression…
permissive · top 1,000 on PyPI
pybcjpybcj provides Python bindings to a BCJ…
copyleft · top 5,000 on PyPI
xopenxopen provides a drop-in replacement for…
permissive · top 5,000 on PyPI
zstdProvides Python bindings to the Zstandard…
permissive · top 5,000 on PyPI
pyvista-zstdCompress and decompress VTK datasets using…
permissive · top 15,000 on PyPI
zstandardProvides Python bindings to the Zstandard…
permissive · top 1,000 on PyPI
pyppmdCompresses and decompresses data using the PPMd…
copyleft · top 5,000 on PyPI
tzsttzst creates and extracts tar archives…
permissive · top 15,000 on PyPI
zipfile-zstdExtends Python's standard zipfile module to…
permissive · top 5,000 on PyPI