tzst
The next-generation Python library engineered for modern archive management, leveraging cutting-edge Zstandard compression to deliver superior performance, security, and reliability
What it is and what it does
tzst is a Python library for creating, extracting, and managing tar archives compressed with Zstandard. It provides both a command-line interface and a programmatic API, supporting atomic file operations, streaming for large archives, and configurable security filters during extraction. The library targets Python 3.12 and later, treating Zstandard compression as a first-class archive format alongside standard tar operations.
The package is built around the zstandard library and offers convenience functions for common tasks (create_archive, extract_archive, list_archive) as well as a lower-level TzstArchive class for fine-grained control. It emphasizes safe defaults—using the 'data' security filter by default during extraction—and provides both .tzst and .tar.zst extension support for compatibility.
Use it for:
- Create compressed backups of directories with better compression ratios than gzip while maintaining tar compatibility.
- Extract large archives in streaming mode to minimize memory usage on resource-constrained systems.
- Automate archive operations in Python scripts using the API without spawning external processes.
- Verify archive integrity before extraction to catch corruption early.
- Distribute pre-built binaries or application bundles using Zstandard compression for faster downloads.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
tzst creates and extracts tar archives compressed with Zstandard, offering a Python API and command-line interface for archive management with streaming support and atomic operations.
Yes, if you need Zstandard-compressed tar archives in Python 3.12+. The library is actively maintained, has no known vulnerabilities, installs with minimal friction, and offers both CLI and API interfaces. The BSD-3-Clause license is permissive. Start with the convenience functions; use the TzstArchive class only if you need fine-grained control.
Install
tzst on PyPI
pip
pip install tzstuv
uv add tzstpoetry
poetry add tzstInstalling tzst
Before you install
Low friction: pure Python wheel with a single runtime dependency (zstandard). Active maintenance with recent releases and a small but growing user base.
License in practice
BSD-3-Clause is permissive; you can use, modify, and distribute tzst freely in commercial and private projects with minimal restrictions.
Quickstart
pip install tzst
from tzst import create_archive, extract_archive
create_archive("archive.tzst", ["file.txt", "dir/"])
extract_archive("archive.tzst", "output/")
Requires Python 3.12 or later.
Verify before relying
- Whether streaming mode provides measurable memory savings for archives of specific sizes.
- Performance comparison with standard tar + gzip or other compression libraries in real-world scenarios.
- Compatibility guarantees with archives created by other Zstandard tar tools.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — zstandard |
| Maintenance | actively maintained — 125 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 206,955/month — #9,560 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tzst-1.3.3-py3-none-any.whl
Keywords: archive, compression, tar, zstandard
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
fastarFastar provides high-performance tar archive…
permissive · top 1,000 on PyPI
rpmfileInspect and extract files from RPM archive…
permissive · top 5,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
pyzstdProvides Python bindings to the Zstandard…
permissive · top 5,000 on PyPI
extractcodeExtracts a wide range of archive formats (tar,…
permissive · top 15,000 on PyPI
patoolPatool is a command-line archive manager that…
copyleft · top 5,000 on PyPI
py7zrpy7zr is a pure-Python library for reading,…
copyleft · top 5,000 on PyPI
libarchive-clibarchive-c provides a Python interface to…
permissive · top 15,000 on PyPI
securetarSecure Tar wraps Python's tarfile module to add…
permissive · top 15,000 on PyPI