zipfly


Namezipfly JSON
Version 6.0.5 PyPI version JSON
download
home_pagehttp://github.com/sandes/zipfly
SummaryZipFly
upload_time2022-10-20 05:34:57
maintainer
docs_urlNone
authorsandes
requires_python
license
keywords zipfly santiago debus santiagodebus.com
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![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/sandes/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 <a href="https://docs.python.org/3/library/zipfile.html#zipfile-objects" target="blank">support</a> 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:<br>    
- <b>paths:</b> [ ] <br/>
- <b>mode:</b> (write) w <br/>
- <b>chunksize:</b> (bytes) 32768 <br/>
- <b>compression:</b> Stored <br/>
- <b>allowZip64:</b> True <br/>
- <b>compresslevel:</b> None <br/>
- <b>storesize:</b> (bytes) 0 <br/>
- <b>encode:</b> utf-8 <br/>

<br/>



`paths` <b>list of dictionaries:</b>

|                   |.                          
|----------------   |-------------------------------      
|**fs**             |Should be the path to a file on the filesystem            
|**n** *(Optional)* |Is the name which it will have within the archive <br> (by default, this will be the same as **fs**)

<br>

```python

    import zipfly

    paths = [
        {
            'fs': '/path/to/large/file'
        },
    ]

    zfly = zipfly.ZipFly(paths = paths)

    generator = zfly.generator()
    print (generator)
    # <generator object ZipFly.generator at 0x7f74d52bcc50>


    with open("large.zip", "wb") as f:
        for i in generator:
            f.write(i)

```


# Examples

> <b>Streaming multiple files in a zip with <a href="https://github.com/sandes/zipfly/blob/master/examples/streaming_django.py" target="_blank">Django</a> or <a href="https://github.com/sandes/zipfly/blob/master/examples/streaming_flask.py" target="_blank">Flask</a></b>
Send forth large files to clients with the most popular frameworks

> <b>Create paths</b>
Easy way to create the array `paths` from a parent folder.

> <b>Predict the size of the zip file before creating it</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>Set a comment</b>
Your own comment in the zip file





            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/sandes/zipfly",
    "name": "zipfly",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "zipfly,Santiago Debus,santiagodebus.com",
    "author": "sandes",
    "author_email": "santidebus@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/64/9e/1a99b30e5e5c99d5f669c6118277d9f34c94a37e20baa2364fd8a15ed7b8/zipfly-6.0.5.tar.gz",
    "platform": null,
    "description": "[![Build Status](https://img.shields.io/circleci/build/github/sandes/zipfly/master)](https://app.circleci.com/pipelines/github/sandes/zipfly)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/sandes/zipfly)\n[![Downloads](https://pepy.tech/badge/zipfly)](https://pepy.tech/project/zipfly)\n\n# ZipFly\n\nZipFly is a zip archive generator based on zipfile.py.\nIt was created to generate very large ZIP archives for immediate sending out to clients, or for writing large ZIP archives without memory inflation.\n\n# Requirements\nPython 3.6+ Added <a href=\"https://docs.python.org/3/library/zipfile.html#zipfile-objects\" target=\"blank\">support</a> for writing to unseekable streams.\n\n# Install\n    pip3 install zipfly\n\n# Basic usage, compress on-the-fly during writes\nUsing 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.\n\n\n`ZipFly` defaults attributes:<br>    \n- <b>paths:</b> [ ] <br/>\n- <b>mode:</b> (write) w <br/>\n- <b>chunksize:</b> (bytes) 32768 <br/>\n- <b>compression:</b> Stored <br/>\n- <b>allowZip64:</b> True <br/>\n- <b>compresslevel:</b> None <br/>\n- <b>storesize:</b> (bytes) 0 <br/>\n- <b>encode:</b> utf-8 <br/>\n\n<br/>\n\n\n\n`paths` <b>list of dictionaries:</b>\n\n|                   |.                          \n|----------------   |-------------------------------      \n|**fs**             |Should be the path to a file on the filesystem            \n|**n** *(Optional)* |Is the name which it will have within the archive <br> (by default, this will be the same as **fs**)\n\n<br>\n\n```python\n\n    import zipfly\n\n    paths = [\n        {\n            'fs': '/path/to/large/file'\n        },\n    ]\n\n    zfly = zipfly.ZipFly(paths = paths)\n\n    generator = zfly.generator()\n    print (generator)\n    # <generator object ZipFly.generator at 0x7f74d52bcc50>\n\n\n    with open(\"large.zip\", \"wb\") as f:\n        for i in generator:\n            f.write(i)\n\n```\n\n\n# Examples\n\n> <b>Streaming multiple files in a zip with <a href=\"https://github.com/sandes/zipfly/blob/master/examples/streaming_django.py\" target=\"_blank\">Django</a> or <a href=\"https://github.com/sandes/zipfly/blob/master/examples/streaming_flask.py\" target=\"_blank\">Flask</a></b>\nSend forth large files to clients with the most popular frameworks\n\n> <b>Create paths</b>\nEasy way to create the array `paths` from a parent folder.\n\n> <b>Predict the size of the zip file before creating it</b>\nUse the `BufferPredictionSize` to compute the correct size of the resulting archive before creating it.\n\n> <b>Streaming a large file</b>\nEfficient way to read a single very large binary file in python\n\n> <b>Set a comment</b>\nYour own comment in the zip file\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "ZipFly",
    "version": "6.0.5",
    "project_urls": {
        "Download": "https://github.com/sandes/zipfly/archive/v6.0.5.tar.gz",
        "Homepage": "http://github.com/sandes/zipfly"
    },
    "split_keywords": [
        "zipfly",
        "santiago debus",
        "santiagodebus.com"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "649e1a99b30e5e5c99d5f669c6118277d9f34c94a37e20baa2364fd8a15ed7b8",
                "md5": "bc1713cf925a4f713d1511f65e8551ef",
                "sha256": "93c56943dca4bf8a1d7de48a15ca9fa8310ade638f2e2493695853a48448efc0"
            },
            "downloads": -1,
            "filename": "zipfly-6.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "bc1713cf925a4f713d1511f65e8551ef",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8233,
            "upload_time": "2022-10-20T05:34:57",
            "upload_time_iso_8601": "2022-10-20T05:34:57.158333Z",
            "url": "https://files.pythonhosted.org/packages/64/9e/1a99b30e5e5c99d5f669c6118277d9f34c94a37e20baa2364fd8a15ed7b8/zipfly-6.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-10-20 05:34:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sandes",
    "github_project": "zipfly",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "circle": true,
    "lcname": "zipfly"
}
        
Elapsed time: 1.04625s