7.17.3 One-shot (de)compression
One-shot compression and decompression is provided through the compress() and decompress() functions.
-
Compress data in one shot. If you want to compress data sequentially,
use an instance of BZ2Compressor instead. The compresslevel
parameter, if given, must be a number between
1
and9
; the default is9
.
- Decompress data in one shot. If you want to decompress data sequentially, use an instance of BZ2Decompressor instead.