Skip to main content

Multi Member GZip Support for Python 3

Project description

Multi GZip

This package is a port of the Python2 gzip implementation with the goal of providing multi-member gzip support. Currently Python3's gzip implementation supports reading multi-member gzip files as a single stream, but does not provide the ability to read or write one member at a time. This is useful for iterating over the members of a gzip file in e.g. WARC files.

Usage Example

from multigzip import GzipFile

with GzipFile(filename='tests.txt.gz', mode='wb') as f:
    f.write_member(b'Hello world 1')
    f.write_member(b'Hello world 2')
    f.write_member(b'Hello world 3')

with GzipFile(filename='tests.txt.gz', mode='r') as f:
    # Note that read() returns a file-like object
    # this is unchanged vs the `gzip2` module ported
    # from warc
    print(f.read_member().read())
    print(f.read_member().read())
    print(f.read_member().read())

Supports Python3 Only

Project details


Download files

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

Files for multigzip, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size multigzip-0.0.2-py3-none-any.whl (9.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size multigzip-0.0.2.tar.gz (7.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page