Skip to main content

fzstd - Python Edition

A Python translation of the high-performance Zstandard (de)compression library fzstd.

This is a pure Python implementation of Zstandard decompression that aims to be compatible with the original TypeScript version.

LLM-driven translation from TypeScript.

Installation

pip install fzstd

Or for development:

pip install -e .

Usage

Basic Decompression

import fzstd

# Decompress data
compressed_data = b'\x28\xb5\x2f\xfd...'  # zstandard compressed bytes
decompressed = fzstd.decompress(bytes(compressed_data))
text = decompressed.decode('utf-8')
print(text)

Streaming Decompression

For decompressing large files or data streams, use the Decompress class:

import fzstd

def handle_chunk(chunk: bytes, final: bool) -> None:
    print(f"Decompressed {len(chunk)} bytes")
    if final:
        print("Decompression complete")

# Create a decompressor with a handler
decompressor = fzstd.Decompress(handle_chunk)

# Push compressed data chunks
decompressor.push(chunk1)
decompressor.push(chunk2)
decompressor.push(final_chunk, final=True)

Limitations

  • Maximum backreference distance: 2^25 bytes (same as TypeScript version)
  • Not compatible with "ultra" compression levels (20+) for files > 32MB decompressed
  • And more!

Testing

Run the test suite:

python tests.py

Origin

This is a translation of the fzstd TypeScript library by Arjun Barrett (@101arrowz).

Original repository: https://github.com/101arrowz/fzstd

Metadata

Release files for fzstd 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fzstd 0.1.1
File Size Uploaded Provenance Actions
fzstd-0.1.1.tar.gz 12.9 kB With provenance Details for fzstd-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fzstd 0.1.1
File Interpreter ABI Platform Actions
fzstd-0.1.1-py3-none-any.whl Python 3 none any Details for fzstd-0.1.1-py3-none-any.whl

Total release size: 23.7 kB

Release files / fzstd-0.1.1.tar.gz

Download URL fzstd-0.1.1.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9cef3f222d00c86a7b537c550de3c7121421439279e288cac4a856724dc6f7b6
BLAKE2b-256 checksum
How to use checksums
28a51f025b6f348dea0ef0176c567a94e2cda19332f64efb8526962f74b0b2e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log

Release files / fzstd-0.1.1-py3-none-any.whl

Download URL fzstd-0.1.1-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9cf2677a0b792656bf8a0b1b2ef7117dfc293ab111b5a479edf7ae3d62c8f51
BLAKE2b-256 checksum
How to use checksums
6dc143c8aabdd73a6da9b493fb2b83a099f11a320a9f309c84ec07d31e01f97d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log

Security for fzstd 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fzstd-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page