{ "info": { "author": "Iv\u00e1n de Paz Centeno", "author_email": "ipazc@unileon.es", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "Natural Language :: English", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "==============\npyzip 0.2.0\n==============\n\n`PyZip` is a package for managing a zip content as a dictionary.\n\n.. image:: https://badge.fury.io/py/pyzip.svg\n :target: https://badge.fury.io/py/pyzip\n\n.. image:: https://travis-ci.org/ipazc/pyzip.svg?branch=master\n :target: https://travis-ci.org/ipazc/pyzip\n\n.. image:: https://coveralls.io/repos/github/ipazc/pyzip/badge.svg?branch=master\n :target: https://coveralls.io/github/ipazc/pyzip?branch=master\n\n.. image:: https://landscape.io/github/ipazc/pyzip/master/landscape.svg?style=flat\n :target: https://landscape.io/github/ipazc/pyzip/master\n :alt: Code Health\n\nIs this zipping process simple enough?\n\n.. code:: python\n\n >>> from pyzip import PyZip\n >>> \n >>> pyzip = PyZip()\n >>> pyzip['key1'] = b\"content_bytes\"\n >>> pyzip['key2'] = file_bytes\n >>>\n >>> pyzip.save(\"/path/to/file.zip\")\n >>> zip_bytes = pyzip.to_bytes() # Alternatively, to bytes\n\nIt is run on top of the module `zipfile`, however, in addition to its functionality, `PyZip` accepts to edit and remove\nelements of a zip. Furthermore, it provides integrity checks to ensure that elements are successfully stored (SHA256 hash).\n\nInstallation\n============\nCurrently it is only supported **Python 3.4.1** onwards:\n\n.. code:: bash\n \n sudo pip3 install pyzip\n\nBasic Usage\n===========\n`PyZip` can easily store content into a zip on the fly. The usage is the same as a normal dictionary:\n\n* Add content to in-memory zip:\n\n.. code:: python\n\n >>> from pyzip import PyZip\n >>> \n >>> pyzip = PyZip()\n >>> pyzip['key1'] = b\"content_bytes\"\n\n\n* Get specific content:\n\n.. code:: python\n\n >>> print(pyzip['key1'])\n b\"content_bytes\"\n \n\n* Edit content:\n\n.. code:: python\n\n >>> pyzip['key1'] = b\"replaced_content_bytes\"\n\n\n* Remove content:\n\n.. code:: python\n\n >>> del pyzip['key1']\n\n\n* Get zip bytes:\n\n.. code:: python\n\n >>> zip_bytes = pyzip.to_bytes()\n\n\n* Load from bytes:\n\n.. code:: python\n\n >>> pyzip = PyZip().from_bytes(zip_bytes)\n \n\n* Save to zip file:\n\n.. code:: python\n\n >>> pyzip.save(\"path/to/file.zip\")\n \n\n* Load from zip file:\n\n.. code:: python\n\n >>> pyzip = PyZip().from_file(\"path/to/file.zip\")\n\n\n* Convert existing dictionary into PyZip:\n\n.. code:: python\n\n >>> pyzip = PyZip({'file1': b'example', 'file2': b'example2'})\n\n\n* It is also possible to convert a multiple level dict into a PyZip:\n\n.. code:: python\n\n >>> pyzip = PyZip({'file1': b'example', 'file2': b'example2', 'folder1': {'file1': b'file1 in folder1'}})\n\n\n \nUse case\n========\n\nPyZip can be used in along with `PyFolder `_ in order to ease the compression and decompression of folders and zips:\n\n\n**Compressing recursively a folder into a zip:**\n\n\n.. code:: python\n\n >>> from pyzip import PyZip\n >>> from pyfolder import PyFolder\n >>>\n >>> path_to_compress = \"route/to/files\"\n >>>\n >>> pyzip = PyZip(PyFolder(path_to_compress, interpret=False))\n >>> pyzip.save(\"compressed_folder.zip\")\n >>>\n\n**Uncompressing recursively a previously compressed folder from a zip:**\n\n.. code:: python\n\n >>> from pyzip import PyZip\n >>> from pyfolder import PyFolder\n >>>\n >>> destination = \"route/for/uncompress\"\n >>>\n >>> pyzip = PyZip(PyFolder(destination, interpret=False)).from_file(\"compressed_folder.zip\", inflate=False)\n >>>\n\nLICENSE\n=======\n\nIt is released under the MIT license.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/ipazc/pyzip", "keywords": "pyzip dict zip file zipfile memory in-memory", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyzip", "package_url": "https://pypi.org/project/pyzip/", "platform": "", "project_url": "https://pypi.org/project/pyzip/", "project_urls": { "Homepage": "http://github.com/ipazc/pyzip" }, "release_url": "https://pypi.org/project/pyzip/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "PyZip is a package for handling zip-in-memory content as a dictionary.", "version": "0.2.0" }, "last_serial": 3234890, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "93c0f170e8a4fa0a476db0abe72e8ee0", "sha256": "9b426ebd92b2f14ea631d3b13f74a0af4dcf74f01fc584132020159e301b11b0" }, "downloads": -1, "filename": "pyzip-0.0.1.tar.gz", "has_sig": false, "md5_digest": "93c0f170e8a4fa0a476db0abe72e8ee0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4369, "upload_time": "2017-09-28T17:43:13", "url": "https://files.pythonhosted.org/packages/5b/3d/c8747172db365462bca7c7f9238ce61ae9d326ec6fb2bad54b50efa649e5/pyzip-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "2fa153938e77670235086076e79ed318", "sha256": "76fa8c7a069d1687aeefc2781f425e49b377a773f80ce4c7539a8acbc0957288" }, "downloads": -1, "filename": "pyzip-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2fa153938e77670235086076e79ed318", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5989, "upload_time": "2017-10-08T03:08:52", "url": "https://files.pythonhosted.org/packages/8c/9c/9d7979c597e1f330ad5449390ee4c10b520c4bac6c49c82426d49f875fa0/pyzip-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "82cb32e7855818e2e90614631acc7dab", "sha256": "c0b10776d798e4be9d5fe6eec541dd0a9740b6550b12fd4cfa238a085686a298" }, "downloads": -1, "filename": "pyzip-0.2.0.tar.gz", "has_sig": false, "md5_digest": "82cb32e7855818e2e90614631acc7dab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6278, "upload_time": "2017-10-08T21:58:11", "url": "https://files.pythonhosted.org/packages/40/72/e29470ecfb5f2bc8cdd2a1b8a6aa14af8d44aa08fe5efa407cd991ce2c64/pyzip-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "82cb32e7855818e2e90614631acc7dab", "sha256": "c0b10776d798e4be9d5fe6eec541dd0a9740b6550b12fd4cfa238a085686a298" }, "downloads": -1, "filename": "pyzip-0.2.0.tar.gz", "has_sig": false, "md5_digest": "82cb32e7855818e2e90614631acc7dab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6278, "upload_time": "2017-10-08T21:58:11", "url": "https://files.pythonhosted.org/packages/40/72/e29470ecfb5f2bc8cdd2a1b8a6aa14af8d44aa08fe5efa407cd991ce2c64/pyzip-0.2.0.tar.gz" } ] }