blosc2.decompress2¶
- blosc2.decompress2(src: object, dst: object | bytearray = None, **kwargs: dict) str | bytes[source]¶
Decompress the given
srcbuffer with the specified decompression params.- Parameters:
src¶ (bytes-like object) – The data to be decompressed. Must support the buffer interface, such as bytes, bytearray, memoryview, or numpy.ndarray.
dst¶ (NumPy object or bytearray, optional) – The destination NumPy object or bytearray to fill. The length must be greater than 0. The user must ensure it has enough capacity for the decompressed data. Default is None, meaning a new bytes object is created, filled and returned.
kwargs¶ (dict, optional) –
Decompression parameters. The default values are in
blosc2.DParams. Supported keyword arguments:- dparams:
blosc2.DParamsor dict All the decompression parameters to use, provided as a
blosc2.DParamsinstance or dict.- others: Any
If dparams is not provided, all the parameters of a
blosc2.DParamscan be passed as keyword arguments.
- dparams:
- Returns:
out – The decompressed data as a Python str or bytes object if
dstis None. Otherwise, it will return None because the result will already be indst.- Return type:
str or bytes
- Raises:
RuntimeError – If the data cannot be compressed into
dst. If an internal error occurs, likely due to an invalid parameter Ifdstis None and a bytes object could not be created to store the result.TypeError – If
srcdoes not support the Buffer Protocol.ValueError – If the length of
srcis smaller than the minimum. Ifdstis not None and its length is 0.