skillfed

pyzstd

Support for Zstandard (zstd) compression

pyzstd v0.19.1 8.5M downloads/30d#1,612 on PyPI49
Permissive license BSD-3-Clause Active released

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 pyzstd

uv

uv add pyzstd

poetry

poetry add pyzstd

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: System :: Archiving :: Compression

Tags

zstandard compression pythonzstd compression bindingspython zstd librarycompress decompress zstseekable compression formatzstandard file compression
compressionzstandardcompatibility-shim

More Compression packages