skillfed

bz2file

Read and write bzip2-compressed files.

bz2file v0.98 326.8K downloads/30d#7,572 on PyPI17
Permissive license Apache License, Version 2.0 Abandoned released

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 on this page — 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

bz2file on PyPI

pip

pip install bz2file

uv

uv add bz2file

poetry

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 not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 4,590 days since the last release
Last repo commit
First released
Downloads 326,812/month — #7,572 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: bz2file-0.98.tar.gz

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.0Programming Language :: Python :: 3.1Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Topic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Archiving :: Compression

Tags

bzip2 file compressionbz2 module replacementread write bzip2 filesmulti-stream bzip2bzip2 decompression python
abandonedlegacy-python

More Python Modules packages