https://github.com/BuzonIO/zipfly Skip to content Sign up * Why GitHub? + Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Issues - + Integrations - + GitHub Sponsors - + Customer stories - * Team * Enterprise * Explore + Explore GitHub - + Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - + Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing + Plans - + Compare plans - + Contact Sales - + Education - [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} BuzonIO / zipfly Public * Notifications * Star 381 * Fork 16 * Writing large ZIP archives without memory inflation buzon.io MIT License 381 stars 16 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show Loading {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default Loading View all tags 11 branches 23 tags Code Loading Latest commit @sandes sandes Merge pull request #77 from beckedorf/add-buffer-to-zip ... 0f2ba98 Nov 20, 2021 Merge pull request #77 from beckedorf/add-buffer-to-zip Add functionality to provide file streams and zip them on the fly 0f2ba98 Git stats * 482 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .circleci circleci change to py3.9 Jul 10, 2021 .github/workflows add github tests Nov 20, 2021 dist new dist May 28, 2020 examples update examples - flask streaming Mar 26, 2021 zipfly.egg-info Package info May 28, 2020 zipfly add option to provide buffers and zip them on the fly Nov 20, 2021 LICENSE Update LICENSE Jan 24, 2021 README.md add pipeline Jul 10, 2021 setup.cfg readme Mar 24, 2020 setup.py classifiers update: py3.9 supported Feb 24, 2021 View code Buzon - ZipFly Requirements Install Basic usage, compress on-the-fly during writes Examples Maintainer License README.md Build Status GitHub release (latest by date) Downloads Buzon - ZipFly ZipFly is a zip archive generator based on zipfile.py. It was created by Buzon.io to generate very large ZIP archives for immediate sending out to clients, or for writing large ZIP archives without memory inflation. Requirements Python 3.6+ Install pip3 install zipfly Basic usage, compress on-the-fly during writes Using this library will save you from having to write the Zip to disk. Some data will be buffered by the zipfile deflater, but memory inflation is going to be very constrained. Data will be written to destination by default at regular 32KB intervals. ZipFly defaults attributes: * paths: [ ] * mode: (write) w * chunksize: (bytes) 32768 * compression: Stored * allowZip64: True * compresslevel: None * storesize: (bytes) 0 * encode: utf-8 paths list of dictionaries: . fs Should be the path to a file on the filesystem n (Optional) Is the name which it will have within the archive (by default, this will be the same as fs) import zipfly paths = [ { 'fs': '/path/to/large/file' }, ] zfly = zipfly.ZipFly(paths = paths) generator = zfly.generator() print (generator) # with open("large.zip", "wb") as f: for i in generator: f.write(i) Examples Streaming multiple files in a zip with Django or Flask Send forth large files to clients with the most popular frameworks Create paths Easy way to create the array paths from a parent folder. Predict the size of the zip file before creating it Use the BufferPredictionSize to compute the correct size of the resulting archive before creating it. Streaming a large file Efficient way to read a single very large binary file in python Set a comment Your own comment in the zip file Maintainer Santiago Debus (@santiagodebus.com) License This library was created by Buzon.io and is released under the MIT. Copyright 2021 Cardallot, Inc. About Writing large ZIP archives without memory inflation buzon.io Topics python streaming compression zipfile buzon zipfly memory-inflation Resources Readme License MIT License Releases 21 v6.0.3 Latest May 28, 2020 + 20 releases Packages 0 No packages published Used by 3 * @lutraconsulting @lutraconsulting / mergin * @unmade @unmade / shelf-back Contributors 2 * @sandes sandes Santi Debus * @beckedorf beckedorf Janis Beckedorf Languages * Python 100.0% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.