All notable changes to this project will be documented in this file.
- Fix
SeekableZstdFilewrite table entries on 32-bits architectures when there is a huge number of entries
- The project has been completely refactored to use the Zstandard implementation from the standard library (PEP-784)
- The refactor has some minor impact on public APIs, such as changing the exception raised on invalid input
- Add
backports.zstddependency for Python before 3.14 - Changes in build dependency: remove
setuptoolsand C build toolchain, addhatchlingandhatch-vcs - Remove git submodule usage
- Drop support for Python 3.9 and below
- Use
ruffas formatter and linter - Embed type hints in Python code, and check with
mypy
- Support for Python 3.14
- Deprecate the
read_sizeandwrite_sizeparameters ofZstdFileandSeekableZstdFile - Deprecate
richmem_compressandRichMemZstdCompressor - Rework documentation to suggest using
compression.zstdfrom Python stdlib, and provide a migration guide - Include the
zstdlibrary license in package distributions
- Upgrade zstd source code from v1.5.6 to v1.5.7
- Raise an exception when attempting to decompress empty data
- Add
ZstdFile.nameproperty - Deprecate
(de)compress_streamfunctions - Use a leading
_for private objects - Build wheels for Windows ARM64
- Support for PyPy 3.11
- Build wheels for Python 3.13
- Deprecate support for Python version before 3.9 and stop building wheels for them
- Compatibility with Python 3.13
- Upgrade zstd source code from v1.5.5 to v1.5.6
- Fix pyzstd_pep517 parameter name in
get_requires_for_build_wheel - Deprecate support for Python version before 3.8 and stop building wheels for them
- Minor fixes in type hints
- Refactor README & CHANGELOG files
- Fix
SeekableZstdFileclass can't open new file in appending mode. - Support sub-interpreter on CPython 3.12+, can utilize per-interpreter GIL.
- On CPython(3.5~3.12)+Linux, use another output buffer code that can utilize the
mremapmechanism. - Change repository URL and maintainer following the deletion of the GitHub account of the original author, Ma Lin (animalize). See #1.
ZstdFile class related changes:
- Add
SeekableZstdFileclass, it's a subclass ofZstdFile, supports Zstandard Seekable Format. - Add mode argument to
ZstdFile.flush()method, now it can flush a zstd frame. - Add read_size and write_size arguments to
ZstdFile.__init__()method, can work with Network File Systems better. - Optimize
ZstdFileperformance to C language level.
ZstdDict class changes:
- Fix these advanced compression parameters may be ignored when loading a dictionary:
windowLog,hashLog,chainLog,searchLog,minMatch,targetLength,strategy,enableLongDistanceMatching,ldmHashLog,ldmMinMatch,ldmBucketSizeLog,ldmHashRateLog, and some non-public parameters. - When compressing, load undigested dictionary instead of digested dictionary by default. Loading again an undigested is slower, see differences.
- Add
.as_prefixattribute. Can use zstd as a patching engine.
- Upgrade zstd source code from v1.5.4 to v1.5.5.
- Upgrade zstd source code from v1.5.2 to v1.5.4. v1.5.3 is a non-public release.
- Support
pyproject.tomlbuild mechanism (PEP-517). Note that specifying build options in old way may be invalid, see build commands. - Support "multi-phase initialization" (PEP-489) on CPython 3.11+, can work with CPython sub-interpreters in the future. Currently this build option is disabled by default.
- Add a command line interface (CLI).
- Fix
ZstdErrorobject can't be pickled.
- Upgrade zstd source code from v1.5.1 to v1.5.2.
- Upgrade zstd source code from v1.5.0 to v1.5.1.
- Fix
ZstdFile.write()/train_dict()/finalize_dict()may use wrong length for some buffer protocol objects. - Two behavior changes:
- Setting
CParameter.nbWorkersto1now means "1-thread multi-threaded mode", rather than "single-threaded mode". - If the underlying zstd library doesn't support multi-threaded compression, no longer automatically fallback to "single-threaded mode", now raise a
ZstdErrorexception.
- Setting
- Add a module level variable
zstd_support_multithread. - Add a setup.py option
--avx2, see build options.
- Upgrade zstd source code from v1.4.9 to v1.5.0.
- Some improvements, no API changes.
- Add a CFFI implementation that can work with PyPy.
- Allow dynamically link to zstd library.
- Upgrade zstd source code from v1.4.8 to v1.4.9.
- Add two convenient functions:
compress_stream()anddecompress_stream(). - Some improvements.
- Upgrade zstd source code from v1.4.5 to v1.4.8.
- v1.4.6 is a non-public release for Linux kernel.
- v1.4.8 is a hotfix for v1.4.7.
- Some improvements, no API changes.
ZstdDecompressorclass: now it has the same API and behavior as BZ2Decompressor / LZMADecompressor classes in Python standard library, it stops after a frame is decompressed.- Add an
EndlessZstdDecompressorclass, it accepts multiple concatenated frames. It is renamed from previousZstdDecompressorclass, but.at_frame_edgeisTruewhen both the input and output streams are at a frame edge. - Rename
zstd_open()function toopen(), consistent with Python standard library. decompress()function:- ~9% faster when: there is one frame, and the decompressed size was recorded in frame header.
- raises ZstdError when input or output data is not at a frame edge. Previously, it only raise for output data is not at a frame edge.
- No longer use Argument Clinic, now supports Python 3.5+, previously 3.7+.
- It seems the API is stable.
- The first version upload to PyPI.
- Includes zstd v1.4.5 source code.