Module bz2
[hide private]
[frames] | no frames]

Module bz2

The python bz2 module provides a comprehensive interface for the bz2 compression library. It implements a complete file interface, one shot (de)compression functions, and types for sequential (de)compression.


Author: The bz2 python module was written by: Gustavo Niemeyer <niemeyer@conectiva.com>

Classes [hide private]
BZ2Compressor
BZ2Compressor([compresslevel=9]) -> compressor object
BZ2Decompressor
BZ2Decompressor() -> decompressor object
BZ2File
BZ2File(name [, mode='r', buffering=0, compresslevel=9]) -> file object
Functions [hide private]
string
compress(data, compresslevel=9)
Compress data in one shot.
decompressed data
decompress(data)
Decompress data in one shot.
Function Details [hide private]

compress(data, compresslevel=9)

 

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 and 9.

Returns: string

decompress(data)

 

Decompress data in one shot. If you want to decompress data sequentially, use an instance of BZ2Decompressor instead.

Returns: decompressed data