--- id: bz2file version: "0.98" license: Apache License, Version 2.0 license_treatment: permissive maintenance: abandoned --- # bz2file — Read and write bzip2-compressed files. License: permissive · Maintenance: abandoned · Downloads: 326.8K/mo ## What it is and what it does Bz2file is a bzip2 file handler for Python that mimics the interface of the standard library's bz2 module. It was designed to backport newer bz2 features (like multi-stream support and additional I/O methods) to older Python versions that lacked them. The package reads and writes bzip2-compressed files, supports both text and binary modes, and can work with any file-like object. The package is now abandoned and has not been updated since 2014-01-19. It remains in the top 15000 PyPI packages by download count, but that reflects historical usage rather than active adoption. High install friction and lack of maintenance make it a poor choice for new projects. Use it for: - Decompress multi-stream bzip2 files on Python versions where the standard bz2 module lacks that support. - Use peek() or read1() methods for incremental bzip2 decompression when the standard library interface is insufficient. - Maintain legacy code written for older Python versions that relied on bz2file's extended interface. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a drop-in replacement for Python's standard library bz2 module with support for multi-stream bzip2 files and additional methods like peek(), read1(), and readinto(). No. The package is abandoned, receives no maintenance or security updates, and has high install friction. Unless you are specifically supporting Python 2.6, 2.7, or 3.0 through 3.4 (all end-of-life), use the built-in bz2 module instead. ## Install pip install bz2file uv add bz2file poetry add bz2file ## Installing bz2file Before you install: High install friction due to source distribution format. Package is abandoned—last release was 2014-01-19 and last commit 2020-07-18—so no active maintenance or security updates are forthcoming. License in practice: Licensed under Apache License, Version 2.0 (permissive), so commercial and private use are permitted without restriction. Quickstart: pip install bz2file import bz2file with bz2file.open('file.bz2', 'rb') as f: data = f.read() Package is abandoned and untested on modern Python versions; compatibility beyond 3.4 is unverified. Verify before relying: - Whether the package works reliably on modern Python versions, given its abandonment and age. - Whether multi-stream bzip2 support is actually needed for your use case, or if the standard library bz2 suffices. - Current compatibility with Python versions released after 3.4. ## Package facts - License: Apache License, Version 2.0 (permissive) - Python support: unspecified - Install friction: high - Maintenance: abandoned - Downloads: 326.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags bzip2 file compression, bz2 module replacement, read write bzip2 files, multi-stream bzip2, bzip2 decompression python, abandoned, legacy-python [View on SkillFed](https://skillfed.io/packages/bz2file) · [View on PyPI](https://pypi.org/project/bz2file/)