Skip to content

Python function to construct a ZIP archive on the fly - without having to store the entire ZIP in memory or disk

License

Notifications You must be signed in to change notification settings

ikreymer/stream-zip

This branch is 3 commits ahead of, 23 commits behind uktrade/stream-zip:main.

Folders and files

NameName
Last commit message
Last commit date
May 27, 2024
Feb 25, 2024
Jul 25, 2024
Aug 12, 2023
Mar 1, 2023
Aug 5, 2023
Dec 29, 2021
Feb 25, 2024
Aug 12, 2023
Feb 18, 2024
Mar 1, 2023
Jun 21, 2024
May 8, 2024
May 27, 2024
Jul 25, 2024

Repository files navigation

stream-zip

conda-forge package PyPI package Test suite Code coverage

Python function to construct a ZIP archive on the fly - without having to store the entire ZIP in memory or disk. This is useful in memory-constrained environments, or when you would like to start returning compressed data before you've even retrieved all the uncompressed data. Generating ZIPs on-demand in a web server is a typical use case for stream-zip.

Offers similar functionality to zipfly, but with a different API, and does not use Python's zipfile module under the hood. Creates both Zip32/2.0/Legacy and Zip64 files.

To unZIP files on the fly try stream-unzip.

Features

In addition to being memory efficient (with some limitations) stream-zip:

  • Constructs ZIP files that can be stream unzipped, for example by stream-unzip

  • Can construct Zip64 ZIP files. Zip64 ZIP files allow sizes far beyond the approximate 4GiB limit of the original ZIP format

  • Can construct ZIP files that contain symbolic links

  • Can construct ZIP files that contain directories, including empty directories

  • Can construct password protected / AES-256 encrypted ZIP files adhering to the WinZip AE-2 specification.

  • Allows the specification of permissions on the member files and directories (although not all clients respect them)

  • By default stores modification time as an extended timestamp. An extended timestamp is a more accurate timestamp than the original ZIP format allows

  • Provides an async interface (that uses threads under the hood)


Visit the stream-zip documentation for usage instructions.

About

Python function to construct a ZIP archive on the fly - without having to store the entire ZIP in memory or disk

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.1%
  • JavaScript 1.4%
  • Shell 0.5%