Metadata-Version: 2.1
Name: zipfly
Version: 6.0.4
Summary: ZipFly
Home-page: http://github.com/buzonIO/zipfly
Author: Buzon
Author-email: support@buzon.io
License: UNKNOWN
Download-URL: https://github.com/BuzonIO/zipfly/archive/v6.0.4.tar.gz
Keywords: zipfly,buzon
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Description-Content-Type: text/markdown
License-File: LICENSE
[![Build Status](https://img.shields.io/circleci/build/github/sandes/zipfly/master)](https://app.circleci.com/pipelines/github/sandes/zipfly)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/buzonio/zipfly)
[![Downloads](https://pepy.tech/badge/zipfly)](https://pepy.tech/project/zipfly)
# ZipFly
ZipFly is a zip archive generator based on zipfile.py.
It was created 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+ Added support for writing to unseekable streams.
# 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**)
```python
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