A Python interface to libarchive. It uses the standard ctypes module to dynamically load and access the C library.
Installation
pip install libarchive-c
python-libarchive-c is compatible with python 2 and 3.
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
Release files for libarchive-c 2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| libarchive-c-2.3.tar.gz | 41.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| libarchive_c-2.3-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 52.5 kB
Release files / libarchive-c-2.3.tar.gz
| Download URL | libarchive-c-2.3.tar.gz |
|---|---|
| Size | 41.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4163a3e536218c8a9207c154dea905ed33437b8855dc408c124f3a93a4693c06
|
|
BLAKE2b-256 checksum How to use checksums |
8a3e2cca91778e366a1e129050dbea470e1a7ac18b02991102a99155edec7e06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / libarchive_c-2.3-py2.py3-none-any.whl
| Download URL | libarchive_c-2.3-py2.py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
9ab746db1e462592493bb1f9d67d822f54184abeb80121acccbf40cb44c1bbc6
|
|
BLAKE2b-256 checksum How to use checksums |
d29399cb8aa1a93a51c72bdf40b01d5894a43f5fef929b31b90548805ea2ed81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |