portage.util.compression_probe module

portage.util.compression_probe._compression_probe_file(f)
portage.util.compression_probe.compression_probe(f)

Identify the compression type of a file. Returns one of the following identifier strings:

bzip2 gzip lz4 lzip lzop xz zstd

Parameters

f (str or file) – a file path, or file-like object

Returns

a string identifying the compression type, or None if the compression type is unrecognized

:rtype str or None