PyDocs

Nav

Data Compression and Archiving

LZMACompressor

lzma

class
  • LZMACompressor(format=FORMAT_XZ, check=-1, preset=None, filters=None)
LZMACompressor(format=FORMAT_XZ, check=-1, preset=None, filters=None)

Create a compressor object for compressing data incrementally.

format specifies the container format to use for the output. This can
be FORMAT_XZ (default), FORMAT_ALONE, or FORMAT_RAW.

check specifies the integrity check to use. For FORMAT_XZ, the default
is CHECK_CRC64. FORMAT_ALONE and FORMAT_RAW do not support integrity
checks; for these formats, check must be omitted, or be CHECK_NONE.

The settings used by the compressor can be specified either as a
preset compression level (with the 'preset' argument), or in detail
as a custom filter chain (with the 'filters' argument). For FORMAT_XZ
and FORMAT_ALONE, the default is to use the PRESET_DEFAULT preset
level. For FORMAT_RAW, the caller must always specify a filter chain;
the raw compressor does not support preset compression levels.

preset (if provided) should be an integer in the range 0-9, optionally
OR-ed with the constant PRESET_EXTREME.

filters (if provided) should be a sequence of dicts. Each dict should
have an entry for "id" indicating the ID of the filter, plus
additional entries for options to the filter.

For one-shot compression, use the compress() function instead.
Members of LZMACompressor

c

compress
Provide data to the compressor object.

f

flush
Finish the compression process.
0 Examples
No examples for lzma/LZMACompressor.
See Also
No see-alsos for lzma/LZMACompressor
0 Notes
No notes for LZMACompressor