Top level API#

This API is meant to be compatible with the existing python-blosc API. There could be some parameters that are called differently, but other than that, they are largely compatible.

Compress and decompress#

compress

Compress src, with a given type size.

compress2

Compress src with the given compression params (if given)

decompress

Decompresses a bytes-like compressed object.

decompress2

Compress src with the given compression params (if given)

pack

Pack (compress) a Python object.

pack_array

Pack (compress) a NumPy array.

pack_array2

Pack (compress) a NumPy array.

pack_tensor

Pack (compress) a TensorFlow / PyTorch tensor or a NumPy array.

unpack

Unpack (decompress) an object.

unpack_array

Restore a packed NumPy array.

unpack_array2

Unpack (decompress) a packed NumPy array via a cframe.

unpack_tensor

Unpack (decompress) a packed TensorFlow / PyTorch via a cframe.

save_array

Save a serialized NumPy array in urlpath.

load_array

Load a serialized NumPy array in urlpath.

save_tensor

Save a serialized PyTorch / TensorFlow tensor or NumPy array in urlpath.

load_tensor

Load a serialized PyTorch / TensorFlow tensor or NumPy array in urlpath.

Set / Get compression params#

clib_info

Return info for compression libraries in C library.

compressor_list

Returns a list of compressors (codecs) available in C library.

detect_number_of_cores

Detect the number of cores in this system.

free_resources

Free possible memory temporaries and thread resources.

get_clib

Return the name of the compression library for Blosc bytesobj buffer.

print_versions

Print all the versions of software that python-blosc2 relies on.

set_blocksize

Force the use of a specific blocksize.

set_nthreads

Set the number of threads to be used during Blosc operation.

nthreads

Number of threads to be used in compression/decompression.

set_releasegil

Sets a boolean on whether to release the Python global inter-lock (GIL) during c-blosc compress and decompress operations or not.

set_compressor

Set the compressor to be used.

get_compressor

Get the current compressor that is used for compression.

get_blocksize

Get the internal blocksize to be used during compression.

Enumerated classes#

Codec

Available codecs.

Filter

Available filters.

SplitMode

Available split modes.