A Python interface to libarchive. It uses the standard ctypes module to dynamically load and access the C library.
Installation
pip install libarchive-c
Compatibility
python-libarchive-c is currently tested with python 2.7, 3.3, 3.4, and 3.5.
If you find an incompatibility with older versions you can send us a small patch, but we won’t accept big changes.
Usage
Import:
import libarchive
To extract an archive to the current directory:
libarchive.extract_file('test.zip')
extract_memory extracts from a buffer instead, and extract_fd extracts from a file descriptor.
To read an archive:
with libarchive.file_reader('test.7z') as archive:
for entry in archive:
for block in entry.get_blocks():
...
memory_reader reads from a memory buffer instead, and fd_reader reads from a file descriptor.
To create an archive:
with libarchive.file_writer('test.tar.gz', 'ustar', 'gzip') as archive:
archive.add_files('libarchive/', 'README.rst')
memory_writer writes to a memory buffer instead, fd_writer writes to a file descriptor, and custom_writer sends the data to a callback function.
You can also find more thorough examples in the tests/ directory.
License
Metadata
Release files for libarchive-c 2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| libarchive-c-2.6.tar.gz | 42.1 kB | Without provenance | Details for libarchive-c-2.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| libarchive_c-2.6-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for libarchive_c-2.6-py2.py3-none-any.whl |
Total release size: 52.8 kB
Release files / libarchive-c-2.6.tar.gz
| Download URL | libarchive-c-2.6.tar.gz |
|---|---|
| Size | 42.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ac3aed19b3125bec143352e2af8379715949fae0d9b16b8945aa107aec539eb
|
|
BLAKE2b-256 checksum How to use checksums |
82ed527c8525208b0b3a469857f1dec5725d3513b0e4f0f9d9690ef22bb25edb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / libarchive_c-2.6-py2.py3-none-any.whl
| Download URL | libarchive_c-2.6-py2.py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
afa5bb7a2ddef2046d705264050e2466e89f7b8c8a681a5ed56256aa6e8b2988
|
|
BLAKE2b-256 checksum How to use checksums |
1d4df65954fbb12826a1f2baea385bfb51994baa3727834935bfa69db527bb5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for libarchive-c 2.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.