blosc2.decompress2(src, dst=None, **kwargs)#

Compress src with the given compression params (if given)

  • src (bytes-like object) – The data to be decompressed. Must be a bytes-like object that supports the Python Buffer Protocol, like bytes, bytearray, memoryview, or numpy.ndarray.

  • dst (NumPy object or bytearray) – The destination NumPy object or bytearray to fill, the length of which must be greater than 0. The user must make sure that it has enough capacity for hosting the decompressed data. Default is None, meaning that a new bytes object is created, filled and returned.

  • kwargs (dict, optional) – Keyword arguments supported: nthreads: int The number of threads to use internally (1 by default).


out – The decompressed data in form of a Python str / bytes object if dst is None. Otherwise, it will return None because the result will already be in dst.

Return type:


  • RuntimeError – If the data cannot be compressed into dst. If an internal error occurred, probably because some parameter is not a valid one. If dst is None and could not create a bytes object to store the result.

  • TypeError – If src does not support the Buffer Protocol.

  • ValueError – If the length of src is smaller than the minimum. If dst is not None and its length is 0.