skillfed

zstd

ZSTD Bindings for Python

zstd v1.5.7.2 9.5M downloads/30d#1,532 on PyPI187
Permissive license BSD Active released

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 zstd

uv

uv add zstd

poetry

poetry add zstd

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: POSIXProgramming Language :: CProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

zstd compression pythonzstandard bindingscompress decompress zstdpython zstd librarylossless compression zstandard
compressionc-extension

More Utilities packages