Zstd

class numcodecs.zstd.Zstd

Codec providing compression using Zstandard.

Parameters:
level : int

Compression level (1-22).

codec_id = 'zstd'
encode(self, buf)
decode(self, buf, out=None)
get_config(self)

Return a dictionary holding configuration parameters for this codec. Must include an ‘id’ field with the codec identifier. All values must be compatible with JSON encoding.

classmethod from_config(cls, config)

Instantiate codec from a configuration object.

Helper functions

numcodecs.zstd.compress()

Compress data.

Parameters:
source : bytes-like

Data to be compressed. Can be any object supporting the buffer protocol.

level : int

Compression level (1-22).

Returns:
dest : bytes

Compressed data.

numcodecs.zstd.decompress()

Decompress data.

Parameters:
source : bytes-like

Compressed data. Can be any object supporting the buffer protocol.

dest : array-like, optional

Object to decompress into.

Returns:
dest : bytes

Object containing decompressed data.