{ "info": { "author": "Dustin Oprea", "author_email": "myselfasunder@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "|Build\\_Status|\n|Coverage\\_Status|\n\n\n------------\nIntroduction\n------------\n\nA ctypes-based adapter to libarchive. The source-code is written to be clear\nand intuitive.\n\nEven 7-Zip is supported for both reading and writing.\n\nI could definitely use some help, if any is available. Completeness will\nrequire a bit more work (see *libarchive*'s archive.h and archive_entry.h).\n\n\n------------\nInstallation\n------------\n\nPyPI::\n\n $ sudo pip install libarchive\n\n\n-----\nNotes\n-----\n\n- The Ubuntu `libarchive` package maintainer only provides a \"libarchive.so\" symlink in the dev package so you'll have to install the `libarchive-dev` package.\n\n For example::\n\n apt-get install libarchive-dev\n\n- Encryption is not currently supported since it's not supported in the underlying library (*libarchive*). Note `this inquiry `_ and the `wishlist item `_.\n\n- OS X has a system version of `libarchive` that is very old. As a result, many users have encountered issues importing an alternate one. Specifically, often they install a different one via Brew but this will not be [sym]linked into the system like other packages. This is a precaution taken by Brew to prevent undefined behavior in the parts of OS X that depend on the factory version. In order to work around this, you should set `LD_LIBRARY_PATH` (or prepend if `LD_LIBRARY_PATH` is already defined) with the path of the location of the library version you want to use. You'll want to set this from your user-profile script (unless your environment can not support this and you need to prepend something like \"LD_LIBRARY_PATH=/some/path\" to the front of the command-line or set it via `os.environ` above where you import this package). A `tool `_ has been provided that will print the path of the first version of `libarchive` installed via Brew. Just copy-and-paste it. Thanks to @SkyLeach for discussing the issue and treatments.\n\n\n---------\nTask List\n---------\n\n===== =================================================\nDone Task\n===== =================================================\n X Read entries from physical file\n X Read entries from archive hosted in memory buffer\n X Write physical files from archive\n X Load memory buffer from archive\n X Populate physical archive from physical files\n X Populate archive hosted in memory buffer\n _ Populate archive entries from memory buffers\n _ Fill-out the entry object's information/accessors\n===== =================================================\n\n\n--------\nExamples\n--------\n\nTo extract to the current directory from a physical file (and print each\nrelative filepath)::\n\n import libarchive.public\n\n for entry in libarchive.public.file_pour('/tmp/test.zip'):\n print(entry)\n\nTo extract to the current directory from memory::\n\n import libarchive.public\n\n with open('/tmp/test.zip', 'rb') as f:\n for entry in libarchive.public.memory_pour(f.read()):\n print(entry)\n\nTo read files from a physical archive::\n\n import libarchive.public\n\n with libarchive.public.file_reader('test.7z') as e:\n for entry in e:\n with open('/tmp/' + str(entry), 'wb') as f:\n for block in entry.get_blocks():\n f.write(block)\n\nTo read files from memory::\n\n import libarchive.public\n\n with open('test.7z', 'rb') as f:\n buffer_ = f.read()\n with libarchive.public.memory_reader(buffer_) as e:\n for entry in e:\n with open('/tmp/' + str(entry), 'wb') as f:\n for block in entry.get_blocks():\n f.write(block)\n\nTo specify a format and/or filter for reads (rather than detecting it)::\n\n import libarchive.public\n import libarchive.constants\n\n with open('test.7z', 'rb') as f:\n buffer_ = f.read()\n with libarchive.public.memory_reader(\n buffer_,\n format_code=libarchive.constants.ARCHIVE_FORMAT_TAR_USTAR,\n filter_code=libarchive.constants.ARCHIVE_FILTER_GZIP\n ) as e:\n for entry in e:\n with open('/tmp/' + str(entry), 'wb') as f:\n for block in entry.get_blocks():\n f.write(block)\n\nTo read the \"filetype\" flag for each entry::\n\n import libarchive.public\n\n with open('test.7z', 'rb') as f:\n buffer_ = f.read()\n with libarchive.public.memory_reader(f.read()) as e:\n for entry in e:\n print(entry.filetype)\n\nThe output of this is::\n\n EntryFileType(IFREG=True, IFLNK=True, IFSOCK=True, IFCHR=False, IFBLK=False, IFDIR=False, IFIFO=False)\n EntryFileType(IFREG=True, IFLNK=True, IFSOCK=True, IFCHR=False, IFBLK=False, IFDIR=False, IFIFO=False)\n EntryFileType(IFREG=True, IFLNK=True, IFSOCK=True, IFCHR=False, IFBLK=False, IFDIR=False, IFIFO=False)\n\nTo create a physical archive from physical files::\n\n import libarchive.public\n import libarchive.constants\n\n libarchive.public.create_file(\n 'create.7z',\n libarchive.constants.ARCHIVE_FORMAT_7ZIP,\n ['/etc/profile']):\n\nThe path of the file to add will be recorded verbatim.\n\n\nTo create an archive in memory from physical files::\n\n import libarchive.public\n import libarchive.constants\n\n with open('/tmp/new.7z', 'wb') as f:\n def writer(buffer_, length):\n f.write(buffer_)\n return length\n\n libarchive.public.create_generic(\n writer,\n format_name=libarchive.constants.ARCHIVE_FORMAT_7ZIP,\n files=['/etc/profile']):\n\n\n-------\nTesting\n-------\n\n*libarchive* uses `nose `_ for testing::\n\n tests$ ./run.py\n\n.. |Build_Status| image:: https://travis-ci.org/dsoprea/PyEasyArchive.svg?branch=master\n :target: https://travis-ci.org/dsoprea/PyEasyArchive\n.. |Coverage_Status| image:: https://coveralls.io/repos/github/dsoprea/PyEasyArchive/badge.svg?branch=master\n :target: https://coveralls.io/github/dsoprea/PyEasyArchive?branch=master", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dsoprea/PyEasyArchive", "keywords": "archive libarchive 7z tar bz2 zip gz", "license": "GPL 2", "maintainer": "", "maintainer_email": "", "name": "libarchive", "package_url": "https://pypi.org/project/libarchive/", "platform": "", "project_url": "https://pypi.org/project/libarchive/", "project_urls": { "Homepage": "https://github.com/dsoprea/PyEasyArchive" }, "release_url": "https://pypi.org/project/libarchive/0.4.7/", "requires_dist": null, "requires_python": "", "summary": "Python adapter for universal, libarchive-based archive access.", "version": "0.4.7" }, "last_serial": 5469492, "releases": { "0.3.10": [ { "comment_text": "", "digests": { "md5": "145566d13cd4a0402ee48e87c53152c4", "sha256": "2cee21a4d7b94f934df62f68977923e004057f0d6ad416dc918ba530ca7974d2" }, "downloads": -1, "filename": "libarchive-0.3.10.tar.gz", "has_sig": false, "md5_digest": "145566d13cd4a0402ee48e87c53152c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6965, "upload_time": "2014-04-22T18:19:31", "url": "https://files.pythonhosted.org/packages/6f/0d/4dae3d89a9e402243bb64602c837c0fc858ce14c6c85f8dde76b8bbf5d53/libarchive-0.3.10.tar.gz" } ], "0.3.7": [ { "comment_text": "", "digests": { "md5": "38305f7b393a6b24de44878781cded50", "sha256": "43a73f8cfa9322aa75189e3d57f9b5b187498607623c45b4055549a82fff3051" }, "downloads": -1, "filename": "libarchive-0.3.7.tar.gz", "has_sig": false, "md5_digest": "38305f7b393a6b24de44878781cded50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5551, "upload_time": "2014-04-17T21:43:10", "url": "https://files.pythonhosted.org/packages/74/32/e9a12b85cfc7b2841e166d44981fbce40d48bcf409c07f53755e3e7e4303/libarchive-0.3.7.tar.gz" } ], "0.3.8": [ { "comment_text": "", "digests": { "md5": "5cac8fb4786142953cfd8d55e2579eb8", "sha256": "270b90bde40b039f9d761b22ab0ab761a4426f01319e62205378fbeeb02a4d88" }, "downloads": -1, "filename": "libarchive-0.3.8.tar.gz", "has_sig": false, "md5_digest": "5cac8fb4786142953cfd8d55e2579eb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5563, "upload_time": "2014-04-21T15:22:33", "url": "https://files.pythonhosted.org/packages/6b/84/3a3d1731bd55850312921df9e78640eeb1f1bce371cb1612dad4b55ed586/libarchive-0.3.8.tar.gz" } ], "0.3.9": [ { "comment_text": "", "digests": { "md5": "acad680f8539e6a5eb5724cade97284f", "sha256": "8acc4abbf1577a4f0570b0935ac3279b08bb9094a14cd1d6d42183b92a461992" }, "downloads": -1, "filename": "libarchive-0.3.9.tar.gz", "has_sig": false, "md5_digest": "acad680f8539e6a5eb5724cade97284f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5631, "upload_time": "2014-04-21T17:30:26", "url": "https://files.pythonhosted.org/packages/db/4a/7ffa9b3eb2c0b29d8378bf524ca5323aec8d259621a9fecd4df2f2bbe1aa/libarchive-0.3.9.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "b14932552e33f8cd7e32b8da2e8492cf", "sha256": "487fca474230fc724fa79ae648f835588557e1d91e3088b92a2795ee5dfaeb32" }, "downloads": -1, "filename": "libarchive-0.4.1.tar.gz", "has_sig": false, "md5_digest": "b14932552e33f8cd7e32b8da2e8492cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7378, "upload_time": "2014-04-24T13:48:12", "url": "https://files.pythonhosted.org/packages/15/dd/afeabec2e0552da8b0c58322e469f966c704de286466193f57c9efb26c36/libarchive-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "363effa8dc8009a948e401694188c8d6", "sha256": "10719aff77d95bdf26d583a180f871f104ec8fb9c3b18b849d28c55431aebae1" }, "downloads": -1, "filename": "libarchive-0.4.2-py2-none-any.whl", "has_sig": false, "md5_digest": "363effa8dc8009a948e401694188c8d6", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 20753, "upload_time": "2014-07-23T18:38:53", "url": "https://files.pythonhosted.org/packages/21/22/86667499f9ad4078a145ada390bb03983dc4db53d91642fc9e2299adbf9a/libarchive-0.4.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7ce1fda227588df931e102143c968190", "sha256": "d93e0c860333a126af8e7023d80f53b117f212960cce12d63687c373dd44a883" }, "downloads": -1, "filename": "libarchive-0.4.2.tar.gz", "has_sig": false, "md5_digest": "7ce1fda227588df931e102143c968190", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7165, "upload_time": "2014-04-24T17:01:59", "url": "https://files.pythonhosted.org/packages/72/2d/af36101196110a087bf95c11ffc0b5dac1765c06b37dbaeb0c7fb002afd5/libarchive-0.4.2.tar.gz" } ], "0.4.3": [ { "comment_text": "", "digests": { "md5": "3bf70356465f58c39159bccb3d724d32", "sha256": "65da680e5b93c06a56899d8c29d3cca08114ddc4713c060a68edd1638ecd6dfe" }, "downloads": -1, "filename": "libarchive-0.4.3-py2-none-any.whl", "has_sig": false, "md5_digest": "3bf70356465f58c39159bccb3d724d32", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 22555, "upload_time": "2014-07-23T20:59:45", "url": "https://files.pythonhosted.org/packages/73/90/39215db5b13cd8d5006f9056d3b169a26b99a50787422b8fc70f1c5bcf53/libarchive-0.4.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fbe7021389f6d37de71e1f7734ac3d9b", "sha256": "5db9bebc1ecc0949e1595c393422184b9855f1c2532689d8d216918e29aa8ca6" }, "downloads": -1, "filename": "libarchive-0.4.3.tar.gz", "has_sig": false, "md5_digest": "fbe7021389f6d37de71e1f7734ac3d9b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10948, "upload_time": "2014-07-23T20:59:42", "url": "https://files.pythonhosted.org/packages/f8/9d/58ac740a97260fcb25de2fd94d993d537b9c68c583a846eca75bff1599cb/libarchive-0.4.3.tar.gz" } ], "0.4.4": [ { "comment_text": "", "digests": { "md5": "7ed2425b05228f1e93e5e0bcf52e4150", "sha256": "84e61e753b7ed45b949e3304e33f076687984cb56f24ad1059a567f65e788560" }, "downloads": -1, "filename": "libarchive-0.4.4.tar.gz", "has_sig": false, "md5_digest": "7ed2425b05228f1e93e5e0bcf52e4150", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13915, "upload_time": "2017-09-25T05:35:08", "url": "https://files.pythonhosted.org/packages/66/32/a05f6f90d0973ee1a64e11a51f6e3679f2b78c578eb7d761f4db823c3d91/libarchive-0.4.4.tar.gz" } ], "0.4.5": [ { "comment_text": "", "digests": { "md5": "e45b49c23cac1e7008868b075f0fda83", "sha256": "b1d813d1111a6d7a3cf3509bd9917585b66eb5bb57fa6fa5aecc9ad7c1b78e94" }, "downloads": -1, "filename": "libarchive-0.4.5.tar.gz", "has_sig": false, "md5_digest": "e45b49c23cac1e7008868b075f0fda83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21085, "upload_time": "2018-05-15T19:11:02", "url": "https://files.pythonhosted.org/packages/ef/ce/d0a87ad17d1125f18f00e3c6ccdcdf0318de1b15a8ac74e045de96da412a/libarchive-0.4.5.tar.gz" } ], "0.4.6": [ { "comment_text": "", "digests": { "md5": "b80973e7f12b12097ec28dd15ac0cf21", "sha256": "37e8cca1eb85d30583cdcffc58116d83abc09be7549d5d6c9ead563c0a8d7b04" }, "downloads": -1, "filename": "libarchive-0.4.6.tar.gz", "has_sig": false, "md5_digest": "b80973e7f12b12097ec28dd15ac0cf21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24418, "upload_time": "2018-07-26T06:02:31", "url": "https://files.pythonhosted.org/packages/b8/89/2952eefad82d9361f539de16ea85a2d98a7fb68eae2ba9ab0869aa2cee0f/libarchive-0.4.6.tar.gz" } ], "0.4.7": [ { "comment_text": "", "digests": { "md5": "63a9f80f57e94fce5a95110b0345597f", "sha256": "829dc298a08877f62335d528973bc034f7c1e8a03c16bfc1fa561e164e76a365" }, "downloads": -1, "filename": "libarchive-0.4.7.tar.gz", "has_sig": false, "md5_digest": "63a9f80f57e94fce5a95110b0345597f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23774, "upload_time": "2019-07-01T03:47:07", "url": "https://files.pythonhosted.org/packages/bf/d4/26f5c9835d4d648e4f22b5fb91288457698e928aaf9d4ab7eff405b7ef03/libarchive-0.4.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "63a9f80f57e94fce5a95110b0345597f", "sha256": "829dc298a08877f62335d528973bc034f7c1e8a03c16bfc1fa561e164e76a365" }, "downloads": -1, "filename": "libarchive-0.4.7.tar.gz", "has_sig": false, "md5_digest": "63a9f80f57e94fce5a95110b0345597f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23774, "upload_time": "2019-07-01T03:47:07", "url": "https://files.pythonhosted.org/packages/bf/d4/26f5c9835d4d648e4f22b5fb91288457698e928aaf9d4ab7eff405b7ef03/libarchive-0.4.7.tar.gz" } ] }