Skip to main content

Read and write bzip2-compressed files.

Project description

Bz2file is a Python library for reading and writing bzip2-compressed files.

It contains a drop-in replacement for the file interface in the standard library’s bz2 module, including features from the latest development version of CPython that are not available in older releases.

Bz2file is compatible with Python 2.6, 2.7, and 3.0 through 3.4.

Features

  • Supports multi-stream files.

  • Can read from or write to any file-like object.

  • Can open files in either text or binary mode.

  • Added methods: peek(), read1(), readinto(), fileno(), readable(), writable(), seekable().

Installation

To install bz2file, run:

$ pip install bz2file

Documentation

The open() function and BZ2File class in this module provide the same features and interface as the ones in the standard library’s bz2 module in the current development version of CPython, documented here.

Version History

0.95: 08 October 2012

  • Added the open() function.

  • Improved performance when reading in small chunks.

  • Removed the fileobj argument to BZ2File(). To wrap an existing file object, pass it as the first argument (filename).

0.9: 04 February 2012

  • Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bz2file-0.95.tar.gz (10.6 kB view details)

Uploaded Source

File details

Details for the file bz2file-0.95.tar.gz.

File metadata

  • Download URL: bz2file-0.95.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bz2file-0.95.tar.gz
Algorithm Hash digest
SHA256 8a36dce337ac541164a065e0cabf761ea23ae90473876a9b361d2e3346edcc52
MD5 8f3ddce80ea09da051fa19fb09ee376e
BLAKE2b-256 fc244dbc62c47472559f9f295fe0e683ca02951d9c3fa838cae25139d68e3605

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page