Skip to main content

Python function to construct a ZIP archive with stream processing - without having to store the entire ZIP in memory or disk

Project description

stream-zip CircleCI Test Coverage

Python function to construct a ZIP archive with stream processing - without having to store the entire ZIP in memory or disk

Installation

pip install stream-zip

Usage

from datetime import datetime
from stream_zip import stream_zip

def unzipped_files():
    modified_at = datetime.now()

    def file_1_data():
        yield b'Some bytes'

    def file_2_data():
        yield b'Some bytes'

    yield 'my-file-1.txt', modified_at, file_1_data()
    yield 'my-file-2.txt', modified_at, file_2_data()

for zipped_chunk in stream_zip(unzipped_files)
    print(zipped_chunk)

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

stream-zip-0.0.1.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

stream_zip-0.0.1-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

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