Standalone

pcodec.standalone.simple_compress(src, config)

Compresses an array into a standalone format.

Parameters:
  • src – numpy array to compress. This must be 1D, contiguous, and one of Pco’s supported data types, e.g. float16, uint64.

  • config – a ChunkConfig object containing compression level and other settings.

Returns:

compressed bytes for an entire standalone file

Raises:

TypeError, RuntimeError

pcodec.standalone.simple_decompress(src)

Decompresses pcodec compressed bytes into a new Numpy array.

Parameters:

src – a bytes object a full standalone file of compressed data.

Returns:

data, either a 1D numpy array of the decompressed values or, in the event that there are no values and the data has no uniform data type metadata, a None.

Raises:

TypeError, RuntimeError

pcodec.standalone.simple_decompress_into(src, dst)

Decompresses pcodec compressed bytes into a pre-existing array.

Parameters:
  • src – a bytes object a full standalone file of compressed data.

  • dst – a numpy array to fill with the decompressed values. Must be both 1D and contiguous.

Returns:

progress, an object with a count of elements written and whether the compressed data was finished. If dst is shorter than the numbers in compressed, fills dst and ignores the numbers that didn’t fit. If dst is longer, fills as much of dst as possible.

Raises:

TypeError, RuntimeError