{ "info": { "author": "Anthon van der Neut", "author_email": "a.van.der.neut@ruamel.eu", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "ruamel.std.zipfile\n==================\n\n`package ruamel.std.zipfile `_ is a drop-in\nimprovements over the standard zipfile package\n\nYou can just replace::\n\n import zipfile\n\nwith::\n\n import ruamel.std.zipfile as zipfile\n\n\nThe package includes InMemoryZipFile, which allows easy creation of ZIP files in memory,\nand allows for streaming or writing out to disc after full creation::\n\n with InMemoryZipFile() as imz:\n imz.append(\"test.txt\", \"Another test\").append(\"test2.txt\", \"Still another\")\n with open('some_file.zip', 'wb') as fp:\n fp.write(imz.data)\n\nwhich will write a two file ZIP file, the first file of which is named\n``test.txt`` with content ``Another test``. The ``.data`` content can\nalso be dynamically returned to a web browser, etc.\n\n\nFile deletion from ZIP\n----------------------\n\nTaking advantage of the delayed writing of ``InMemoryZipFile``, the\nfunction ``delete_from_zip_file(file_name, pattern, file_names)``,\ntakes a ``string`` or ``pathlib.Path`` as file_name.\n\nAny files matching the pattern, if provided, are deleted from the\nfile, as well as are any files matching ``file_names`` (a list of\nstring/Path, single non-list instances are allowed).\n\nThe following deletes any files ending in `.pth` and the file\n`tmp/README.rst` from a ZIP file ``test.zip``::\n\n delete_from_zip_file('test.zip', pattern='.*.pth', file_names=['README.rst'])\n\nor::\n\n delete_from_zip_file('test.zip', pattern='.*.pth', file_names='README.rst')\n\nor::\n\n delete_from_zip_file('test.zip', pattern=re.compile('.*.pth'), file_names='README.rst')\n\n\n*Please note that this a ``re`` pattern not a ``glob`` pattern.*\nYou can, but don't have to provide a pattern compiled with\n``re.compile()``\n\n\nThe ZIP file is recreated and recompressed, take this into account\nwhen deleting files (restrict the size of files you handle, combine\npatterns instead of doing multiple calls).", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/ruamel/std.zipfile", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "ruamel.std.zipfile", "package_url": "https://pypi.org/project/ruamel.std.zipfile/", "platform": "", "project_url": "https://pypi.org/project/ruamel.std.zipfile/", "project_urls": { "Homepage": "https://bitbucket.org/ruamel/std.zipfile" }, "release_url": "https://pypi.org/project/ruamel.std.zipfile/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "improvements over the standard zipfile package", "version": "0.1.0" }, "last_serial": 2548174, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "2e11b9a44d9ae4783bc8837b76686e6d", "sha256": "797e000fef6da0f25005d9c666ca8564ec70b8bf8521ddf51ff4cca8c8b35b36" }, "downloads": -1, "filename": "ruamel.std.zipfile-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2e11b9a44d9ae4783bc8837b76686e6d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6545, "upload_time": "2017-01-01T09:53:52", "url": "https://files.pythonhosted.org/packages/27/16/7ed3633177023d6d186b9731128fa320d739f29defe47371db00ee1c75f9/ruamel.std.zipfile-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cf7153801cfd1211e3fb68c73f684b94", "sha256": "d7cc5ffdb24897670305d616ff2d864dbfc00c55b9b37dec2d08d046c76d1a30" }, "downloads": -1, "filename": "ruamel.std.zipfile-0.1.0.tar.gz", "has_sig": false, "md5_digest": "cf7153801cfd1211e3fb68c73f684b94", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11272, "upload_time": "2017-01-01T09:53:39", "url": "https://files.pythonhosted.org/packages/bd/ad/f954e535b2ae686277be56a3164c4eb55743c469ad81750b0769a5718bb1/ruamel.std.zipfile-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2e11b9a44d9ae4783bc8837b76686e6d", "sha256": "797e000fef6da0f25005d9c666ca8564ec70b8bf8521ddf51ff4cca8c8b35b36" }, "downloads": -1, "filename": "ruamel.std.zipfile-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2e11b9a44d9ae4783bc8837b76686e6d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6545, "upload_time": "2017-01-01T09:53:52", "url": "https://files.pythonhosted.org/packages/27/16/7ed3633177023d6d186b9731128fa320d739f29defe47371db00ee1c75f9/ruamel.std.zipfile-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cf7153801cfd1211e3fb68c73f684b94", "sha256": "d7cc5ffdb24897670305d616ff2d864dbfc00c55b9b37dec2d08d046c76d1a30" }, "downloads": -1, "filename": "ruamel.std.zipfile-0.1.0.tar.gz", "has_sig": false, "md5_digest": "cf7153801cfd1211e3fb68c73f684b94", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11272, "upload_time": "2017-01-01T09:53:39", "url": "https://files.pythonhosted.org/packages/bd/ad/f954e535b2ae686277be56a3164c4eb55743c469ad81750b0769a5718bb1/ruamel.std.zipfile-0.1.0.tar.gz" } ] }