Create a decompressor object for decompressing data incrementally.
For one-shot decompression, use the decompress() function instead. Data found after the end of the compressed stream.True if the end-of-stream marker has been reached.decompress(data) -> bytes
Provide data to the decompressor object. Returns a chunk of decompressed data if possible, or b'' otherwise.
Attempting to decompress data after the end of stream is reached raises an EOFError. Any data found after the end of the stream is ignored and saved in the unused_data attribute. BZ2Compressor(compresslevel=9)
Create a compressor object for compressing data incrementally.
compresslevel, if given, must be a number between 1 and 9.
For one-shot compression, use the compress() function instead. flush() -> bytes
Finish the compression process. Returns the compressed data left in internal buffers.
The compressor object may not be used after this method is called. compress(data) -> bytes
Provide data to the compressor object. Returns a chunk of compressed data if possible, or b'' otherwise.
When you have finished providing data to the compressor, call the flush() method to finish the compression process.