This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Python interface to libarchive

Project Description

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.

Release History

Release History

This version
History Node

2.7

History Node

2.6

History Node

2.5

History Node

2.4

History Node

2.3

History Node

2.2

History Node

2.1

History Node

2.0

History Node

1.1

History Node

1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
libarchive_c-2.7-py2.py3-none-any.whl (10.7 kB) Copy SHA256 Checksum SHA256 3.5 Wheel Dec 17, 2016
libarchive-c-2.7.tar.gz (42.3 kB) Copy SHA256 Checksum SHA256 Source Dec 17, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting