{ "info": { "author": "NVRAM", "author_email": "nvram@users.sourceforge.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Archiving :: Packaging", "Topic :: Utilities" ], "description": "targzstream\n===========\n\nVersion: 1.1\n\nSummary\n-------\n\nThis module provides an extension to the standard tarfile.TarFile class\nwhich provides the ability to add files to a TarFile that are compressed\non-the-fly. It will only work on an uncompressed output tarfile, since after\nthe data is written it will overwrite the header for the file with the\ncorrect size data.\n\nLimitations\n-----------\n\n- The object to which the tarfile is being written must support \"seek()\", so\n this cannot work over a socket, nor presumably with a compressed tarfile.\n *Note: re-compressing contents is not very useful.*\n\n- The \"close_gz_file\" method will be called when calling \"close\" on the\n file stream.\n *Note: close_gz_file() and close_file() are interchangeable.*\n\n- The constructor does not support reading, use the `open()` class method or\n use the base class `tarfile.TarFile` constructor.\n\n\nExample Usage\n-------------\n\n.. code:: python\n\n #!/usr/bin/env python3\n import os, sys, shutil\n\n import targzstream\n\n # USAGE: ./foo.py TARFILE INPUT [ INPUT2 ... ]\n # Eg: ./foo.py myoutput.tar *.cpp *.h\n\n with targzstream.TarFile(sys.argv[1], mode='w') as tarball:\n for fname in sys.argv[2:]:\n st = os.stat(fname)\n with tarball.add_gz_file(name=fname + '.gz', mtime=st.st_mtime,\n uid=st.st_uid, gid=st.st_gid, mode=st.st_mode) as fout:\n # Copy the data.\n with open(fname, 'rb') as fin:\n shutil.copyfileobj(fin, fout)\n # The end.\n\nTODO\n----\n\n- Have *add_gz_file* handle the result of an *os.stat*. Eg:\n\n .. code:: python\n\n with tarball.gz_file(name=fname + '.gz', stat=os.stat(fname)) as obj:\n with open(fname, 'rb') as fin:\n shutil.copyfileobj(fin, obj)\n\n- Wrap *add_gz_file* and *close_gz_file* as a context manager.\n\n *Done.*\n\n- Allow streaming uncompressed files, too.\n\n *Done.*", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/n2vram/targzstream/archive/1.1", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/n2vram/targzstream", "keywords": "tarfile,gzip,streaming", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "targzstream", "package_url": "https://pypi.org/project/targzstream/", "platform": "any", "project_url": "https://pypi.org/project/targzstream/", "project_urls": { "Download": "https://github.com/n2vram/targzstream/archive/1.1", "Homepage": "https://github.com/n2vram/targzstream" }, "release_url": "https://pypi.org/project/targzstream/1.1/", "requires_dist": null, "requires_python": "", "summary": "An extension to tarfile to allow adding files to a tarfile, without the need to write to disk first. It also allows data to be compressed as it is added to the tarfile, for large files or data that might be generated on the fly. Note that the output file object must support \"seek()\", hence the output must be an uncompressed tar file. Currently, only GZip is supported for compression.", "version": "1.1" }, "last_serial": 3444050, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "a592177013a4fce0caa1e1018277b0d1", "sha256": "6b52ef34e9a249d54ff71c5338f5e672158fddd6c3efd5204321febf2c11abdc" }, "downloads": -1, "filename": "targzstream-1.0.tar.gz", "has_sig": false, "md5_digest": "a592177013a4fce0caa1e1018277b0d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3581, "upload_time": "2017-04-23T06:54:49", "url": "https://files.pythonhosted.org/packages/b3/e4/fc1565dd5768b1fd682be8d08a7a9975ccb183f5a1df6d26f8a224de3e35/targzstream-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "1db4f8ef76d2e2f4291c77a5b064e93f", "sha256": "a1590674ae677c7e23cd3bb7f3961f9a10771474fe96635f3c02e87761b3c5b7" }, "downloads": -1, "filename": "targzstream-1.1.tar.gz", "has_sig": false, "md5_digest": "1db4f8ef76d2e2f4291c77a5b064e93f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3773, "upload_time": "2017-09-23T16:40:49", "url": "https://files.pythonhosted.org/packages/11/90/bfaf25c10cc779f644d421fd705d21b3bc169bcb797d3aa568a3b7eb57af/targzstream-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1db4f8ef76d2e2f4291c77a5b064e93f", "sha256": "a1590674ae677c7e23cd3bb7f3961f9a10771474fe96635f3c02e87761b3c5b7" }, "downloads": -1, "filename": "targzstream-1.1.tar.gz", "has_sig": false, "md5_digest": "1db4f8ef76d2e2f4291c77a5b064e93f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3773, "upload_time": "2017-09-23T16:40:49", "url": "https://files.pythonhosted.org/packages/11/90/bfaf25c10cc779f644d421fd705d21b3bc169bcb797d3aa568a3b7eb57af/targzstream-1.1.tar.gz" } ] }