NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #177 most downloaded on PyPI
Zstandard bindings for Python
Last release 1 years ago
14 Sep 2025
Ships fairly regularly
a new release about every 4 months
Most releases are documented
notes for 32 of 42 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
42 releases · first in 2016
A workaround is to use --config-settings=--global-option=... instead. --global-option apparently is deprecated and the setuptools folks have yet to fi…
Py_REFCNT(obj) instead of accessing (*obj)->ob_refcnt directly.PYTHON_ZSTANDARD_IMPORT_POLICY environment variable now has leading cffi and cffi arecffi.cibuildwheel and uv (where possible). This change should be backwardspyproject.toml build backend has been switched fromsetuptools.build_meta:__legacy__ to setuptools.build_meta.--config-settings=--build-option=... as part of implementing PEP 660.--config-settings=--global-option=... instead.--global-option apparently is deprecated and the setuptools folks have yetsetup.py invocations.--build-option is sent to the build_wheel command but not thebuild_editable command.)manylinux_2_28 (versusmanylinux2014) for older Python versions. This may raise the minimummanylinux2014 and glibc 2.17.pythoncapi_compat.h file has been upgraded to the latest version. (#278)setup.py now depends on packaging and uses packaging.version.VersionVersion classes.zstandard.backend_c.* versus zstd.* before. The names have beenmultiprocessing orconcurrent.futures packages), which would fail to pickle types likeZstdError before since the fully qualified type name referenced anzstd). (#248)One column per quarter.
We now collections.abs.Buffer on Python 3.12+ instead of typing.ByteString , as typing.ByteString was deprecated and later removed. ( #238 , #262 )
setup.py will likely yield a working install. However, this is not officially supported.pyproject.toml file now defines a [project] section.collections.abs.Buffer on Python 3.12+ instead of typing.ByteString, as typing.ByteString was deprecated and later removed. (#238, #262)get_frame_parameters() now accepts an optional format argument defining the zstandard frame type. You can pass e.g. zstandard.FORMAT_ZSTD1_MAGICLESS to decode frames without header magic. (#217)During the release process of this version, we uploaded the source archive to PyPI after some wheels. PyPI rejected the source archive because of presence of a license-file entry while using metadata version 2.4. We manually generated the source distribution locally. The source distribution on PyPI therefore does not match what GitHub Actions produced.
zstd 1.5.6, new wheels, and some other misc changes.
zstd 1.5.6, new wheels, and some other misc changes.
Bundled zstd library upgraded from 1.5.5 to 1.5.6.
Releases now publish wheels for manylinux2014_ppc64le, manylinux2014_s390x, musllinux_1_2_aarch64, musllinux_1_2_i686, musllinux_1_2_ppc64le, musllinux_1_2_s390x, and musllinux_1_2_x86_64.
PyO3 Rust crate upgraded from 0.18 to 0.21.
Semi official support for CPython 3.13. Binary wheels for 3.13 are now published during releases. There were no meaningful code changes to support Python 3.13. Support is semi official since 3.13 is still in beta and 3.13 is currently being built against a pre-release version of cffi 1.17. We also lack a Rust extension for 3.13 since PyO3 lacks a release with 3.13 support.
pyproject.toml now lists version constraints of [build-system] requirements, not exact versions. This should provide more compatibility with more environments. setuptools is held back before 69.0.0 because that version apparently broke support for using --global-settings=--build-option in editable installs, which our CI relies on.
ZstdDecompressor.decompressobj() will change read_across_frames to default to True in a future release. If you depend on the current functionality of
ZstdDecompressor.decompressobj() will change read_across_frames toTrue in a future release. If you depend on the currentread_across_frames=False to preserve the current behavior.manylinux2010 wheels are no longer published since this wheel formatsetup.pyZstdDecompressor.decompressobj() now accepts a read_across_framesFalse to preserve existingpyproject.toml now declares a [build-system] section saying to buildsetup.py directly.Support for Python 3.6 has been dropped. Python 3.7 is the minimum supported Python version.
PyType_Spec and corresponding APIs. (#187) Contributed byUse of the deprecated ZSTD_copyDCtx() was removed from the C and Rust backends.
ZSTD_copyDCtx() was removed from the C andThe C backend implementation of ZstdDecompressionObj.decompress() could have raised an assertion in cases where the function was called multiple times
ZstdDecompressionObj.decompress() couldcompiler.preprocessor if itZstdDecompressionObj.decompress() was refactored.unused_data was setZSTD_decompressStream() in some scenarios, possibly improving performance.ZstdDecompressor.decompress() how has a read_across_frames keywordread_across_frames=FalseZstdDecompressor.decompress() now has an allow_extra_data keywordallow_extra_data=True so behavior won't change during a future upgrade.Let's get a release out the door.
Let's get a release out the door.
Bundled zstd library upgraded from 1.5.1 to 1.5.2.
ZstdDecompressionObj now has an unused_data attribute. It will contain data beyond the fully decoded zstd frame data if said data exists.
ZstdDecompressionObj now has an unconsumed_tail attribute. This attribute currently always returns the empty bytes value (b"").
ZstdDecompressionObj now has an eof attribute returning whether the compressed data has been fully read.
Let's push out a new release so we publish zstd 1.5.1.
Let's push out a new release so we publish zstd 1.5.1.
ZstdCompressionWriter and ZstdDecompressionWriter now implement __iter__() and __next__(). The methods always raise io.UnsupportedOperation. The added methods are part of the io.IOBase abstract base class / interface and help ensure instances look like other I/O types. (#167, #168)
The HASHLOG3_MAX constant has been removed since it is no longer defined in zstd 1.5.1.
The ZstdCompressionReader, ZstdCompressionWriter, ZstdDecompressionReader, and ZstdDecompressionWriter types in the C backend now tracks their closed attribute using the proper C type. Before, due to a mismatch between the C struct type and the type declared to Python, Python could read the wrong bits on platforms like s390x and incorrectly report the value of the closed attribute to Python. (#105, #164)
Bundled zstd library upgraded from 1.5.0 to 1.5.1.
The C backend now exposes the symbols ZstdCompressionReader, ZstdCompressionWriter, ZstdDecompressionReader, and ZstdDecompressionWriter. This should match the behavior of the CFFI backend. (#165)
ZstdCompressionWriter and ZstdDecompressionWriter now implement __iter__ and __next__, which always raise io.UnsupportedOperation.
Documentation on thread safety has been updated to note that derived objects like ZstdCompressionWriter have the same thread unsafety as the contexts they were derived from. (#166)
Support for Python 3.5 has been dropped. Python 3.6 is now the minimum required Python version.
manylinux2014_aarch64 wheels are now being produced for CPython 3.6+. (#145).ZstdCompressor() and ZstdDecompressor() are now all optional in the C backend and an explicit None value is accepted. Before, the C backend wouldn't accept an explicit None value (but the CFFI backend would). The new behavior should be consistent between the backends. (#153)ZstdCompressor.multi_compress_to_buffer() and ZstdDecompressor.multi_decompress_to_buffer() are no longer available when linking against a system zstd
ZstdCompressor.multi_compress_to_buffer() and
ZstdDecompressor.multi_decompress_to_buffer() are no longer
available when linking against a system zstd library. These
experimental features are only available when building against the
bundled single file zstd C source file distribution. (#106)setup.py now recognizes a ZSTD_EXTRA_COMPILER_ARGS
environment variable to specify additional compiler arguments
to use when compiling the C backend..pyi type annotations file has replaced various default argument
values with ....setup.py no longer attempts to build the C backend on PyPy.
setup.py no longer attempts to build the C backend on PyPy. (#130)<sys/types.h> is now included before <sys/sysctl.h>. This was
the case in releases prior to 0.15.0 and the include order was reversed
as part of running clang-format. The old/working order has been
restored. (#128)The deprecated overlap_size_log attribute on ZstdCompressionParameters instances has been removed. The overlap_log attribute should be used instead.
train_dictionary() now uses the fastcover training mechanism
(as opposed to cover). Some parameter values that worked with the old
mechanism may not work with the new one. e.g. d must be 6 or 8
if it is defined.train_dictionary() now always calls
ZDICT_optimizeTrainFromBuffer_fastCover() instead of different APIs
depending on which arguments were passed.zstandard.backend_c instead of zstd. The
CFFI extension module is now built as zstandard._cffi instead of
_zstd_cffi. The CFFI backend is now zstandard.backend_cffi instead
of zstandard.cffi.ZstdDecompressionReader.seekable() now returns False instead of
True because not all seek operations are supported and some Python
code in the wild keys off this value to determine if seek() can be
called for all scenarios.ZstdDecompressionReader.seek() now raises OSError instead of
ValueError when the seek cannot be fulfilled. (#107)ZstdDecompressionReader.readline() and
ZstdDecompressionReader.readlines() now accept an integer argument.
This makes them conform with the IO interface. The methods still raise
io.UnsupportedOperation.ZstdCompressionReader.__enter__ and ZstdDecompressionReader.__enter__
now raise ValueError if the instance was already closed.overlap_size_log attribute on ZstdCompressionParameters
instances has been removed. The overlap_log attribute should be used
instead.overlap_size_log argument to ZstdCompressionParameters
has been removed. The overlap_log argument should be used instead.ldm_hash_every_log attribute on
ZstdCompressionParameters instances has been removed. The
ldm_hash_rate_log attribute should be used instead.ldm_hash_every_log argument to
ZstdCompressionParameters has been removed. The ldm_hash_rate_log
argument should be used instead.CompressionParameters type alias to
ZstdCompressionParamaters has been removed. Use
ZstdCompressionParameters.ZstdCompressor.read_from() and
ZstdDecompressor.read_from() have been removed. Use the corresponding
read_to_iter() methods instead.ZstdCompressor.write_to() and
ZstdDecompressor.write_to() have been removed. Use the corresponding
stream_writer() methods instead.ZstdCompressor.copy_stream(), ZstdCompressorIterator.__next__(),
and ZstdDecompressor.copy_stream() now raise the original exception
on error calling the source stream's read() instead of raising
ZstdError. This only affects the C backend.ZstdDecompressionObj.flush() now returns bytes instead of
None. This makes it behave more similarly to flush() methods
for similar types in the Python standard library. (#78)ZstdCompressionWriter.__exit__() now always calls close().
Previously, close() would not be called if the context manager
raised an exception. The old behavior was inconsistent with other
stream types in this package and with the behavior of Python's
standard library IO types. (#86)cffi as an install_requires
except when running on PyPy. Instead, cffi is listed as an
extras_require.ZstdCompressor.stream_reader() and ZstdDecompressor.stream_reader()
now default to closing the source stream when the instance is itself
closed. To change this behavior, pass closefd=False. (#76)CFFI backend now defines
ZstdCompressor.multi_compress_to_buffer() and
ZstdDecompressor.multi_decompress_to_buffer(). However, they
raise NotImplementedError, as they are not yet implemented.CFFI backend now exposes the types ZstdCompressionChunker,
ZstdCompressionObj, ZstdCompressionReader,
ZstdCompressionWriter, ZstdDecompressionObj,
ZstdDecompressionReader, and ZstdDecompressionWriter as
symbols on the zstandard module.CFFI backend now exposes the types BufferSegment,
BufferSegments, BufferWithSegments, and
BufferWithSegmentsCollection. However, they are not implemented.ZstdCompressionWriter.flush() now calls flush() on the inner stream
if such a method exists. However, when close() itself calls
self.flush(), flush() is not called on the inner stream.ZstdDecompressionWriter.close() no longer calls flush() on
the inner stream. However, ZstdDecompressionWriter.flush() still
calls flush() on the inner stream.ZstdCompressor.stream_writer() and ZstdDecompressor.stream_writer()
now have their write_return_read argument default to True.
This brings the behavior of write() in compliance with the
io.RawIOBase interface by default. The argument may be removed
in a future release.ZstdCompressionParameters no longer exposes a compression_strategy
property. Its constructor no longer accepts a compression_strategy
argument. Use the strategy property/argument instead.stream_reader decompressor when reader is closed
before reading everything. (Patch by Pierre Fersing.)ZstdCompressionWriter.write()
now catches exceptions when calling the inner stream's write().
ZstdCompressionWriter.flush() on inner stream's write().
ZstdCompressor.copy_stream() on dest stream's write().
ZstdDecompressionWriter.write() on inner stream's write().
ZstdDecompressor.copy_stream() on dest stream's write(). (#102)PyBuffer instances are no longer checked to be C contiguous and
have a single dimension. The former was redundant with what
PyArg_ParseTuple() already did and the latter is not necessary
in practice because very few extension modules create buffers with
more than 1 dimension. (#124)zstandard module. (#120)make_cffi.py script should now respect the CC environment
variable for locating the compiler. (#103)cffi backend when running all tests.train_dictionary() has been rewritten to use the fastcover APIs
and to consistently call ZDICT_optimizeTrainFromBuffer_fastCover()
instead of different C APIs depending on what arguments were passed.
The function also now accepts arguments f, split_point, and
accel, which are parameters unique to fastcover.zstd.c file renamed to c-ext/backend_c.c.zstandard
package. Previously, there were modules in other packages. (#115)clang-format.ZstdCompressor.stream_writer(), ZstdCompressor.stream_reader(),
ZstdDecompressor.stream_writer(), and
ZstdDecompressor.stream_reader() now accept a closefd
argument to control whether the underlying stream should be closed
when the ZstdCompressionWriter, ZstdCompressReader,
ZstdDecompressionWriter, or ZstdDecompressionReader is closed.
(#76)zstandard.open() function for returning a file
object with zstd (de)compression. (#64)zstandard module now exposes a backend_features
attribute containing a set of strings denoting optional features
present in that backend. This can be used to sniff feature support
by performing a string lookup instead of sniffing for API presence
or behavior.ZstdCompressionParameters now exposes a strategy property.compress() and decompress() convenience functions
on the zstandard module. These are simply wrappers around the
corresponding APIs on ZstdCompressor and ZstdDecompressor.This release should contain no functional changes compared to 0.14.0. The only expected difference with this version is Python 3.9 wheels are now bein
This release should contain no functional changes compared to 0.14.0. The only expected difference with this version is Python 3.9 wheels are now being produced.
This will likely be the final version supporting Python 2.7. Future releases will likely only work on Python 3.5+. See #109 for more context.
make_cffi.py script used to build the CFFI bindings now
calls distutils.sysconfig.customize_compiler() so compiler
customizations (such as honoring the CC environment variable)
are performed. Patch by @Arfrever. (#103)make_cffi.py script now sets LC_ALL=C when invoking
the preprocessor in an attempt to normalize output to ASCII. (#95)setup.py is now executable.pytest-xdist pytest extension is now installed so tests can be run in parallel.
pytest-xdist pytest extension is now installed so tests can be
run in parallel.manylinux2010 and manylinux2014 binary wheels
instead of a mix of manylinux2010 and manylinux1.Support for Python 3.4 has been dropped since Python 3.4 is no longer a supported Python version upstream. (But it will likely continue to work until
ZstdDecompressor.__init__ on 64-bit big-endian systems (#91).ZstdDecompressionReader.seek() (#82).pytest for running tests (from nose).Fix memory leak in ZstdDecompressionReader.seek() (#82).
Fix memory leak in ZstdDecompressionReader.seek() (#82).
The overlap_size_log attribute on CompressionParameters instances has been deprecated and will be removed in a future release. The overlap_log attribu…
ZstdCompressor.stream_reader(), ZstdCompressor.stream_writer(), ZstdDecompressor.stream_reader(), and ZstdDecompressor.stream_writer() should now completely implement the io.RawIOBase interface, allowing them to be used as fully-featured streams. One can combine an instance with say an io.TextIOWrapper, codecs.StreamReader, or codecs.StreamWriter to transparently convert between binary and textual data or apply encodings to data. A stream reader or writer should interoperate with any Python code that accepts a stream-like object. Please note that some implementation details may change slightly in the future in order to ensure better compatibility with the stream interfaces.ZstdDecompressor.stream_reader() can now read inputs that have multiple zstd frames. Look for future releases to improve support for reading sources with multiple frames.ZstdDecompressor.read() now allows reading sizes of -1 or 0
and defaults to -1, per the documented behavior of
io.RawIOBase.read(). Previously, we required an argument that was
a positive value.readline(), readlines(), __iter__, and __next__ methods
of ZstdDecompressionReader() now raise io.UnsupportedOperation
instead of NotImplementedError.ZstdDecompressor.stream_reader() now accepts a read_across_frames
argument. The default value will likely be changed in a future release
and consumers are advised to pass the argument to avoid unwanted change
of behavior in the future.setup.py now always disables the CFFI backend if the installed
CFFI package does not meet the minimum version requirements. Before, it was
possible for the CFFI backend to be generated and a run-time error to
occur.CompressionReader and DecompressionReader
were renamed to ZstdCompressionReader and ZstdDecompressionReader,
respectively so naming is identical to the C extension. This should have
no meaningful end-user impact, as instances aren't meant to be
constructed directly.ZstdDecompressor.stream_writer() now accepts a write_return_read
argument to control whether write() returns the number of bytes
read from the source / written to the decompressor. It defaults to off,
which preserves the existing behavior of returning the number of bytes
emitted from the decompressor. The default will change in a future release
so behavior aligns with the specified behavior of io.RawIOBase.ZstdDecompressionWriter.__exit__ now calls self.close(). This
will result in that stream plus the underlying stream being closed as
well. If this behavior is not desirable, do not use instances as
context managers.ZstdCompressor.stream_writer() now accepts a write_return_read
argument to control whether write() returns the number of bytes read
from the source / written to the compressor. It defaults to off, which
preserves the existing behavior of returning the number of bytes emitted
from the compressor. The default will change in a future release so
behavior aligns with the specified behavior of io.RawIOBase.ZstdCompressionWriter.__exit__ now calls self.close(). This will
result in that stream plus any underlying stream being closed as well. If
this behavior is not desirable, do not use instances as context managers.ZstdDecompressionWriter no longer requires being used as a context
manager (#57).ZstdCompressionWriter no longer requires being used as a context
manager (#57).overlap_size_log attribute on CompressionParameters instances
has been deprecated and will be removed in a future release. The
overlap_log attribute should be used instead.overlap_size_log argument to CompressionParameters has been
deprecated and will be removed in a future release. The overlap_log
argument should be used instead.ldm_hash_every_log attribute on CompressionParameters instances
has been deprecated and will be removed in a future release. The
ldm_hash_rate_log attribute should be used instead.ldm_hash_every_log argument to CompressionParameters has been
deprecated and will be removed in a future release. The ldm_hash_rate_log
argument should be used instead.compression_strategy argument to CompressionParameters has been
deprecated and will be removed in a future release. The strategy
argument should be used instead.SEARCHLENGTH_MIN and SEARCHLENGTH_MAX constants are deprecated
and will be removed in a future release. Use MINMATCH_MIN and
MINMATCH_MAX instead.zstd_cffi module has been renamed to zstandard.cffi. As had
been documented in the README file since the 0.9.0 release, the
module should not be imported directly at its new location. Instead,
import zstandard to cause an appropriate backend module to be loaded
automatically.ZstdDecompressionObj.decompress(). The issue has been fixed.ZstdDecompressionReader.read() if there was data remaining in an
internal buffer. The issue has been fixed. (#71)ZstDecompressionObj.decompress() now properly handles empty inputs in
the CFFI backend.ZstdCompressionReader now implements read1() and readinto1().
These are part of the io.BufferedIOBase interface.ZstdCompressionReader has gained a readinto(b) method for reading
compressed output into an existing buffer.ZstdCompressionReader.read() now defaults to size=-1 and accepts
read sizes of -1 and 0. The new behavior aligns with the documented
behavior of io.RawIOBase.ZstdCompressionReader now implements readall(). Previously, this
method raised NotImplementedError.ZstdDecompressionReader now implements read1() and readinto1().
These are part of the io.BufferedIOBase interface.ZstdDecompressionReader.read() now defaults to size=-1 and accepts
read sizes of -1 and 0. The new behavior aligns with the documented
behavior of io.RawIOBase.ZstdDecompressionReader() now implements readall(). Previously, this
method raised NotImplementedError.readline(), readlines(), __iter__, and __next__ methods
of ZstdDecompressionReader() now raise io.UnsupportedOperation
instead of NotImplementedError. This reflects a decision to never
implement text-based I/O on (de)compressors and keep the low-level API
operating in the binary domain. (#13)README.rst now documented how to achieve linewise iteration using
an io.TextIOWrapper with a ZstdDecompressionReader.ZstdDecompressionReader has gained a readinto(b) method for
reading decompressed output into an existing buffer. This allows chaining
to an io.TextIOWrapper on Python 3 without using an io.BufferedReader.ZstdDecompressor.stream_reader() now accepts a read_across_frames
argument to control behavior when the input data has multiple zstd
frames. When False (the default for backwards compatibility), a
read() will stop when the end of a zstd frame is encountered. When
True, read() can potentially return data spanning multiple zstd
frames. The default will likely be changed to True in a future
release.setup.py now performs CFFI version sniffing and disables the CFFI
backend if CFFI is too old. Previously, we only used install_requires
to enforce the CFFI version and not all build modes would properly enforce
the minimum CFFI version. (#69)ZstdDecompressionReader.read() now properly handles data
remaining in any internal buffer. Before, repeated read() could
result in random errors. (#71)CompressionReader and DecompressionReader
were renamed to ZstdCompressionReader and ZstdDecompressionReader,
respectively.ZstdDecompressor.stream_writer() now accepts a write_return_read
argument to control whether write() returns the number of bytes read
from the source. It defaults to False to preserve backwards
compatibility.ZstdDecompressor.stream_writer() now implements the io.RawIOBase
interface and behaves as a proper stream object.ZstdCompressor.stream_writer() now accepts a write_return_read
argument to control whether write() returns the number of bytes read
from the source. It defaults to False to preserve backwards
compatibility.ZstdCompressionWriter now implements the io.RawIOBase interface and
behaves as a proper stream object. close() will now close the stream
and the underlying stream (if possible). __exit__ will now call
close(). Methods like writable() and fileno() are implemented.ZstdDecompressionWriter no longer must be used as a context manager.ZstdCompressionWriter no longer must be used as a context manager.
When not using as a context manager, it is important to call
flush(FRAME_FRAME) or the compression stream won't be properly
terminated and decoders may complain about malformed input.ZstdCompressionWriter.flush() (what is returned from
ZstdCompressor.stream_writer()) now accepts an argument controlling the
flush behavior. Its value can be one of the new constants
FLUSH_BLOCK or FLUSH_FRAME.ZstdDecompressionObj instances now have a flush([length=None]) method.
This provides parity with standard library equivalent types. (#65)CompressionParameters no longer redundantly store individual compression
parameters on each instance. Instead, compression parameters are stored inside
the underlying ZSTD_CCtx_params instance. Attributes for obtaining
parameters are now properties rather than instance variables.STRATEGY_BTULTRA2 constant.CompressionParameters instances now expose an overlap_log attribute.
This behaves identically to the overlap_size_log attribute.CompressionParameters() now accepts an overlap_log argument that
behaves identically to the overlap_size_log argument. An error will be
raised if both arguments are specified.CompressionParameters instances now expose an ldm_hash_rate_log
attribute. This behaves identically to the ldm_hash_every_log attribute.CompressionParameters() now accepts a ldm_hash_rate_log argument that
behaves identically to the ldm_hash_every_log argument. An error will be
raised if both arguments are specified.CompressionParameters() now accepts a strategy argument that behaves
identically to the compression_strategy argument. An error will be raised
if both arguments are specified.MINMATCH_MIN and MINMATCH_MAX constants were added. They are
semantically equivalent to the old SEARCHLENGTH_MIN and
SEARCHLENGTH_MAX constants.setup.py denotes support for Python 3.7 (Python 3.7 was supported and
tested in the 0.10 release).zstd_cffi module has been renamed to zstandard.cffi.ZstdCompressor.stream_writer() now reuses a buffer in order to avoid
allocating a new buffer for every operation. This should result in faster
performance in cases where write() or flush() are being called
frequently. (#62)zstd_cffi.py added to setup.py (#60).
zstd_cffi.py added to setup.py (#60).ssize_t (#61).ZstdCompressor.stream_reader().closed is now a property instead of a method (#58).
ZstdCompressor.stream_reader().closed is now a property instead of a
method (#58).ZstdDecompressor.stream_reader().closed is now a property instead of a
method (#58).ZstdCompressor.stream_reader()'s and ZstdDecompressor.stream_reader()'s
closed attribute is now a read-only property instead of a method. This now
properly matches the IOBase API and allows instances to be used in more
places that accept IOBase instances.ZstdDecompressor.stream_reader().read() now consistently requires an argument in both the C and CFFI backends. Before, the CFFI implementation would a
ZstdDecompressor.stream_reader().read() now consistently requires an
argument in both the C and CFFI backends. Before, the CFFI implementation
would assume a default value of -1, which was later rejected.compress_literals argument and attribute has been removed from
zstd.ZstdCompressionParameters because it was removed by the zstd 1.3.5
API.ZSTD_CCtx_setParametersUsingCCtxParams() is no longer called on every
operation performed against ZstdCompressor instances. The reason for this
change is that the zstd 1.3.5 API no longer allows this without calling
ZSTD_CCtx_resetParameters() first. But if we called
ZSTD_CCtx_resetParameters() on every operation, we'd have to redo
potentially expensive setup when using dictionaries. We now call
ZSTD_CCtx_reset() on every operation and don't attempt to change
compression parameters.ZstdCompressor.stream_reader() no longer need to be
used as a context manager. The context manager interface still exists and its
behavior is unchanged.ZstdDecompressor.stream_reader() no longer need to be
used as a context manager. The context manager interface still exists and its
behavior is unchanged.ZstdDecompressor.decompressobj().decompress() should now return all data
from internal buffers in more scenarios. Before, it was possible for data to
remain in internal buffers. This data would be emitted on a subsequent call
to decompress(). The overall output stream would still be valid. But if
callers were expecting input data to exactly map to output data (say the
producer had used flush(COMPRESSOBJ_FLUSH_BLOCK) and was attempting to
map input chunks to output chunks), then the previous behavior would be
wrong. The new behavior is such that output from
flush(COMPRESSOBJ_FLUSH_BLOCK) fed into decompressobj().decompress()
should produce all available compressed input.ZstdDecompressor.stream_reader().read() should no longer segfault after
a previous context manager resulted in error (#56).ZstdCompressor.compressobj().flush(COMPRESSOBJ_FLUSH_BLOCK) now returns
all data necessary to flush a block. Before, it was possible for the
flush() to not emit all data necessary to fully represent a block. This
would mean decompressors wouldn't be able to decompress all data that had been
fed into the compressor and flush()ed. (#55).BLOCKSIZELOG_MAX, BLOCKSIZE_MAX,
TARGETLENGTH_MAX that expose constants from libzstd.ZstdCompressor.chunker() API for manually feeding data into a
compressor and emitting chunks of a fixed size. Like compressobj(), the
API doesn't impose restrictions on the input or output types for the
data streams. Unlike compressobj(), it ensures output chunks are of a
fixed size. This makes this API useful when the compressed output is being
fed into an I/O layer, where uniform write sizes are useful.ZstdCompressor.stream_reader() no longer needs to be used as a context
manager (#34).ZstdDecompressor.stream_reader() no longer needs to be used as a context
manager (#34).zstandard.__version__ is now defined (#50).This release contains packaging improvements. No changes to the Python library code were made in this release.
This release contains packaging improvements. No changes to the Python library code were made in this release.
Debian packaging support.
Fix typo in setup.py (#44).
Support building with mingw compiler (#46).
Switch from deprecated ZSTD_getDecompressedSize() to ZSTD_getFrameContentSize() replacement.
zstandard. Please change imports of zstd
and zstd_cffi to import zstandard. See the README for more. Support
for importing the old names will be dropped in the next release.ZstdCompressor.read_from() and ZstdDecompressor.read_from() have
been renamed to read_to_iter(). read_from() is aliased to the new
name and will be deleted in a future release.selectivity argument to train_dictionary() has been removed, as
the feature disappeared from zstd 1.3.train_cover_dictionary() has effectively been renamed to
train_dictionary().allow_empty argument from ZstdCompressor.compress() has been
deleted and the method now allows empty inputs to be compressed by default.estimate_compression_context_size() has been removed. Use
CompressionParameters.estimated_compression_context_size() instead.get_compression_parameters() has been removed. Use
CompressionParameters.from_level() instead.CompressionParameters.__init__() have changed. If you
were using positional arguments before, the positions now map to different
arguments. It is recommended to use keyword arguments to construct
CompressionParameters instances.TARGETLENGTH_MAX constant has been removed (it disappeared from zstandard
1.3.4).ZstdCompressor.write_to() and ZstdDecompressor.write_to() have been
renamed to ZstdCompressor.stream_writer() and
ZstdDecompressor.stream_writer(), respectively. The old names are still
aliased, but will be removed in the next major release.ZstdCompressor(write_content_size=True) is now the default).CompressionParameters has been renamed to ZstdCompressionParameters
for consistency with other types. The old name is an alias and will be removed
in the next major release.ZstdCompressor.copy_stream() (#40) (from 0.8.2).ZstdDecompressor.copy_stream() (#35) (from 0.8.2).ZSTD_DDict instances in CFFI's ZstdDecompressor.stream_reader() API that exposes the io.RawIOBase interface (allows
you to .read() from a file-like object).memoryview and bytearray) (#26).ZstdDecompressor.stream_reader() API to obtain a read-only i/o stream
of decompressed data for a source.ZstdCompressor.stream_reader() API to obtain a read-only i/o stream of
compressed data for a source.ZstdDecompressor.read_from() to ZstdDecompressor.read_to_iter().
The old name is still available.ZstdCompressor.read_from() to ZstdCompressor.read_to_iter().
read_from() is still available at its old location.zstandard module to import and re-export the C or CFFI
backend as appropriate. Behavior can be controlled via the
PYTHON_ZSTANDARD_IMPORT_POLICY environment variable. See README for
usage info.CONTENTSIZE_UNKNOWN and CONTENTSIZE_ERROR.STRATEGY_BTULTRA compression strategy constant.ZSTD_getDecompressedSize() to
ZSTD_getFrameContentSize() replacement.ZstdCompressor.compress() can now compress empty inputs without requiring
special handling.ZstdCompressor and ZstdDecompressor now have a memory_size()
method for determining the current memory utilization of the underlying zstd
primitive.train_dictionary() has new arguments and functionality for trying multiple
variations of COVER parameters and selecting the best one.LDM_MINMATCH_MIN, LDM_MINMATCH_MAX, and
LDM_BUCKETSIZELOG_MAX.ZSTD_compress_generic()CompressionParameters.__init__ now accepts several more arguments,
including support for long distance matching.ZstdCompressionDict.__init__ now accepts a dict_type argument that
controls how the dictionary should be interpreted. This can be used to
force the use of content-only dictionaries or to require the presence
of the dictionary magic header.ZstdCompressionDict.precompute_compress() can be used to precompute the
compression dictionary so it can efficiently be used with multiple
ZstdCompressor instances.ZstdCompressionDict instances,
created automatically on first use, and automatically reused by all
ZstdDecompressor instances bound to that dictionary.ZstdDecompressor.decompressobj() now accepts a write_size argument
to control how much work to perform on every decompressor invocation.ZstdCompressor.write_to() now exposes a tell(), which exposes the
total number of bytes written so far.ZstdDecompressor.stream_reader() now supports seek() when moving
forward in the stream.TARGETLENGTH_MAX constant.frame_header_size(data) function.frame_content_size(data) function.ZSTD_decompress* have been switched to the new advanced
decompression API.ZstdCompressor and ZstdCompressionParams can now be constructed with
negative compression levels.ZstdDecompressor now accepts a max_window_size argument to limit the
amount of memory required for decompression operations.FORMAT_ZSTD1 and FORMAT_ZSTD1_MAGICLESS constants to be used with
the format compression parameter to control whether the frame magic
header is written.ZstdDecompressor now accepts a format argument to control the
expected frame format.ZstdCompressor now has a frame_progression() method to return
information about the current compression operation.b'' literals.ZstdCompressor(write_content_size=True) and
CompressionParameters(write_content_size=True) the default.CompressionParameters has been renamed to ZstdCompressionParameters.Fixed memory leak in ZstdCompressor.copy_stream() (#40).
ZstdCompressor.copy_stream() (#40).ZstdDecompressor.copy_stream() (#35).Add #includes so compilation on OS X and BSDs works (#20).
CompressionParameters now has a estimated_compression_context_size() method. zstd.estimate_compression_context_size() is now deprecated and slated for…
CompressionParameters instances no longer are subscriptable nor behave as tuples (backwards incompatible). Use attributes to obtain values.
Added zstd.get_frame_parameters() to obtain info about a zstd frame.
Added ZstdDecompressor.decompress_content_dict_chain() for efficient decompression of content-only dictionary chains.
CFFI module fully implemented; all tests run against both C extension and CFFI implementation.
Vendored version of zstd updated to 1.1.3.
Use ZstdDecompressor.decompress() now uses ZSTD_createDDict_byReference() to avoid extra memory allocation of dict data.
Add function names to error messages (by using ":name" in PyArg_Parse* functions).
Reuse decompression context across operations. Previously, we created a new ZSTD_DCtx for each decompress(). This was measured to slow down decompression by 40-200MB/s. The API guarantees say ZstdDecompressor is not thread safe. So we reuse the ZSTD_DCtx across operations and make things faster in the process.
ZstdCompressor.write_to()'s compress() and flush() methods now return number of bytes written.
ZstdDecompressor.write_to()'s write() method now returns the number of bytes written to the underlying output object.
CompressionParameters instances now expose their values as attributes.
CompressionParameters instances no longer are subscriptable nor behave as tuples (backwards incompatible). Use attributes to obtain values.
DictParameters instances now expose their values as attributes.
Support for legacy zstd protocols (build time opt in feature).
Support for legacy zstd protocols (build time opt in feature).
Automation improvements to test against Python 3.6, latest versions of Tox, more deterministic AppVeyor behavior.
CFFI "parser" improved to use a compiler preprocessor instead of rewriting source code manually.
Vendored version of zstd updated to 1.1.2.
Documentation improvements.
Introduce a bench.py script for performing (crude) benchmarks.
ZSTD_CCtx instances are now reused across multiple compress() operations.
ZstdCompressor.write_to() now has a flush() method.
ZstdCompressor.compressobj()'s flush() method now accepts an argument to flush a block (as opposed to ending the stream).
Disallow compress(b'') when writing content sizes by default (issue #11).
more packaging fixes for source distribution
more packaging fixes for source distribution
setup_zstd.py is included in the source distribution
setup_zstd.py is included in the source distribution
Vendored version of zstd updated to 1.1.1.
Vendored version of zstd updated to 1.1.1.
Continuous integration for Python 3.6 and 3.7
Continuous integration for Conda
Added compression and decompression APIs providing similar interfaces to the standard library zlib and bz2 modules. This allows coding to a common interface.
zstd.__version__ is now defined.
read_from() on various APIs now accepts objects implementing the buffer protocol.
read_from() has gained a skip_bytes argument. This allows callers to pass in an existing buffer with a header without having to create a slice or a new object.
Implemented ZstdCompressionDict.as_bytes().
Python's memory allocator is now used instead of malloc().
Low-level zstd data structures are reused in more instances, cutting down on overhead for certain operations.
distutils boilerplate for obtaining an Extension instance has now been refactored into a standalone setup_zstd.py file. This allows other projects with setup.py files to reuse the distutils code for this project without copying code.
The monolithic zstd.c file has been split into a header file defining types and separate .c source files for the implementation.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →