cramjam.xz
xz and lzma de/compression interface
def
compress( data, preset=None, format=None, check=None, filters=None, options=None, output_len=None):
LZMA compression.
Python Example
>>> _ = cramjam.xz.compress(b'some bytes here')
>>> # Defaults to XZ format, you can use the deprecated LZMA format like this:
>>> _ = cramjam.xz.compress(b'some bytes here', format=cramjam.xz.Format.ALONE)
def
compress_into( input, output, preset=None, format=None, check=None, filters=None, options=None):
Compress directly into an output buffer
def
decompress(data, output_len=None):
LZMA decompression.
Python Example
>>> # bytes or bytearray; bytearray is faster
>>> cramjam.xz.decompress(compressed_bytes, output_len=Optional[None])
def
decompress_into(input, output):
Decompress directly into an output buffer
class
Compressor:
XZ Compressor object for streaming compression
class
Decompressor:
Decompressor object for streaming decompression
NB This is mostly here for API complement to Compressor
You'll almost always be statisfied with de/compress
/ de/compress_into
functions.
class
Filter:
Available Filter IDs
Arm =
Filter.Arm
ArmThumb =
Filter.ArmThumb
Ia64 =
Filter.Ia64
Lzma1 =
Filter.Lzma1
Lzma2 =
Filter.Lzma2
PowerPC =
Filter.PowerPC
Sparc =
Filter.Sparc
X86 =
Filter.X86
class
MatchFinder:
MatchFinder, used with Options.mf attribute
HashChain3 =
MatchFinder.HashChain3
HashChain4 =
MatchFinder.HashChain4
BinaryTree2 =
MatchFinder.BinaryTree2
BinaryTree3 =
MatchFinder.BinaryTree3
BinaryTree4 =
MatchFinder.BinaryTree4
class
Mode:
MatchFinder, used with Options.mode attribute
Fast =
Mode.Fast
Normal =
Mode.Normal
class
FilterChain:
FilterChain, similar to the default Python XZ filter chain which is a list of dicts.
class
FilterChainItem:
FilterChainItem. In Python's lzma module, this represents a single dict in the
filter chain list. To be added to the FilterChain
class
Options:
class
Format:
Possible formats
AUTO =
Format.AUTO
XZ =
Format.XZ
ALONE =
Format.ALONE
RAW =
Format.RAW
class
Check:
Possible Check configurations
Crc64 =
Check.Crc64
Crc32 =
Check.Crc32
Sha256 =
Check.Sha256
None =
Check.None