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
Python function to construct a ZIP archive with stream processing - without having to store the entire ZIP in memory or disk
Offers similar functionality to zipfly, but with a different API, and does not use Python's zipfile module under the hood.
Installation
pip install stream-zip
Usage
from datetime import datetime
from stream_zip import stream_zip
def unzipped_files():
modified_at = datetime.now()
perms = 0o600
def file_1_data():
yield b'Some bytes'
def file_2_data():
yield b'Some bytes'
yield 'my-file-1.txt', modified_at, perms, file_1_data()
yield 'my-file-2.txt', modified_at, perms, file_2_data()
for zipped_chunk in stream_zip(unzipped_files)
print(zipped_chunk)
Project details
Release history Release notifications | RSS feed
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.5.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for stream_zip-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 970394563d8b8106a6f106512e7db55448f4007d5177686685da4edebce0e83d |
|
MD5 | 1f8e31178b835063b5444abc5cf6626b |
|
BLAKE2b-256 | 23ef8d7cf4070f699a2ce06de25075f33550d3a0541035834dadc876ae376feb |