-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from BuzonIO/alpha2
Alpha2
- Loading branch information
Showing
3 changed files
with
88 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,93 @@ | ||
Metadata-Version: 1.1 | ||
Metadata-Version: 2.1 | ||
Name: zipfly | ||
Version: 2.0.1 | ||
Version: 2.1.2 | ||
Summary: ZipFly | ||
Home-page: http://github.com/buzonIO/zipfly | ||
Author: Buzon | ||
Author-email: [email protected] | ||
License: UNKNOWN | ||
Download-URL: https://github.com/BuzonIO/zipfly/archive/v2.0.1.tar.gz | ||
Description: UNKNOWN | ||
Download-URL: https://github.com/BuzonIO/zipfly/archive/v2.1.2.tar.gz | ||
Description: [](https://pepy.tech/project/zipfly) | ||
|
||
# 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.5+ | ||
|
||
# Install | ||
pip3 install zipfly | ||
|
||
# Basic usage, compress on-the-fly during writes | ||
Basic use case is compressing on the fly. Some data will be buffered by the zipfile deflater, but memory inflation is going to be very constrained. Data will be written to destination at fairly regular intervals. | ||
|
||
`ZipFly` default attributes: | ||
|
||
- <b>paths:</b> [ ] <br/> | ||
- <b>mode:</b> w <br/> | ||
- <b>chunksize:</b> (bytes) 16384 <br/> | ||
- <b>compression:</b> Stored <br/> | ||
- <b>allowZip64:</b> True <br/> | ||
- <b>compresslevel:</b> None <br/> | ||
- <b>storesize:</b> (bytes) 0 <br/> | ||
|
||
|
||
<br/> | ||
|
||
`paths` <b>list of dictionaries:</b> | ||
|
||
- `fs` (filesystem): `path from your disk`<br> | ||
- `n` (name): `final path in zip file` | ||
|
||
|
||
```python | ||
import zipfly | ||
|
||
paths = [ | ||
{ | ||
'fs': 'home/user/Videos/jupiter.mp4', | ||
'n': 'movies/jupiter.mp4', | ||
}, | ||
{ | ||
'fs': 'home/user/Documents/mercury.mp4', | ||
'n': 'movies/mercury.mp4', | ||
}, | ||
] | ||
|
||
zfly = zipfly.ZipFly( paths = paths ) | ||
|
||
generator = zfly.generator() | ||
print ( generator ) | ||
# <generator object generator at 0x7f85aad60b13> | ||
|
||
with open("test.zip", "wb") as f: | ||
for i in generator: | ||
f.write(i) | ||
|
||
|
||
``` | ||
# Examples | ||
|
||
> <b>Create a ZIP file with size estimation</b> | ||
Use the `BufferPredictionSize` to compute the correct size of the resulting archive before creating it. | ||
|
||
> <b>Streaming a large file</b> | ||
Efficient way to read a single very large binary file in python | ||
|
||
> <b>Streaming multiple files in a zip</b> | ||
The easiest is to use the Django or Flask built-in streaming feature | ||
|
||
|
||
# Maintainer | ||
Santiago Debus <a href="http://santiagodebus.com/" target="_blank">(@santiagodebus.com)</a><br> | ||
|
||
<i>Santiago's open-source projects are supported by his Patreon. If you found this project helpful, any monetary contributions to the Patreon are appreciated and will be put to good creative use.</i> | ||
|
||
# License | ||
This library was created by Buzon.io and is released under the MIT. Copyright 2020 Grow HQ, Inc. | ||
|
||
Keywords: zipfly,buzon | ||
Platform: UNKNOWN | ||
Classifier: Development Status :: 5 - Production/Stable | ||
|
@@ -18,3 +98,4 @@ Classifier: Programming Language :: Python :: 3.5 | |
Classifier: Programming Language :: Python :: 3.6 | ||
Classifier: Programming Language :: Python :: 3.7 | ||
Classifier: Programming Language :: Python :: 3.8 | ||
Description-Content-Type: text/markdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters