--- id: backports-zstd version: "1.6.0" license: PSF-2.0 license_treatment: permissive maintenance: active --- # backports.zstd — Backport of compression.zstd License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install backports-zstd uv add backports-zstd poetry add backports-zstd ## Description
# backports.zstd Backport of [PEP-784 “adding Zstandard to the standard library”][PEP-784] [![GitHub build status](https://img.shields.io/github/actions/workflow/status/rogdham/backports.zstd/build.yml?branch=master)](https://github.com/rogdham/backports.zstd/actions?query=branch:master) [![Release on PyPI](https://img.shields.io/pypi/v/backports.zstd)](https://pypi.org/project/backports.zstd/) --- [📖 PEP-784][PEP-784]   |   [📃 Changelog](./CHANGELOG.md) [PEP-784]: https://peps.python.org/pep-0784/
--- ## Install Add the following dependency to your project: ``` backports.zstd ; python_version<'3.14' ``` …or just run `pip install backports.zstd`. ## Usage When importing a module needing Zstandard support, use a conditional import based on the version of Python. See below for examples. ### zstd ```python import sys if sys.version_info >= (3, 14): from compression import zstd else: from backports import zstd # use the zstd module, for example: zstd.compress(b"Hello, world!") ``` Refer to the [official Python documentation][doc-zstd] for usage of the module. [doc-zstd]:... ## AI interpretation — verify before relying Provides Zstandard (zstd) compression support for Python versions before 3.14, backporting PEP-784's standard library compression module along with zstd-enabled tarfile and zipfile modules. Verdict: A well-maintained, production-stable backport of PEP-784's zstd compression for older Python versions. No security vulnerabilities reported. Medium install friction is expected for a compiled extension with broad platform coverage. Suitable for projects needing zstd support before Python 3.14. [View on SkillFed](https://skillfed.io/packages/backports-zstd) · [View on PyPI](https://pypi.org/project/backports-zstd/)