The python-bz2 module provides a comprehensive Python interface for the bz2 compression library. It implements a complete file interface, one shot (de)compression functions, and types for sequential (de)compression.
python-bz2 provides the following features:
BZ2File implements complete file interface, including readline(), readlines(), xreadlines(), writelines(), seek(), etc;
BZ2File implements emulated seek() support;
Sequential (de)compression supported by BZ2Compressor and BZ2Decompressor types;
- One shot (de)compression supported by compress() and decompress() functions;
- Complete inline documentation;
- Thread safety uses individual locking mechanism;
- Comprehensive unit tests.
There's pydoc-generated documentation available.
This module is distributed with Python itself since version 2.3.
As a reference, the obsolete version is also available.
Gustavo Niemeyer <firstname.lastname@example.org>