--- id: libarchive-c version: "5.3" license: CC0 license_treatment: permissive maintenance: aging --- # libarchive-c — Python interface to libarchive License: permissive · Maintenance: aging · Downloads: 396.8K/mo ## What it is and what it does libarchive-c is a thin ctypes wrapper around the libarchive C library, exposing archive operations to Python without requiring compiled extensions. It lets you extract, read, and create archives in multiple formats—tar, zip, 7z, bz2, gz—by calling Python functions that delegate to the underlying C library. The package is designed for straightforward archive manipulation: extract files to disk, iterate over archive contents and read blocks, or build new archives from files and in-memory data. It supports reading from files, file descriptors, memory buffers, or custom callbacks, and writing to similar destinations. You can control extraction security flags, preserve or resolve symbolic links, and specify metadata codecs for non-UTF-8 filenames. Use it for: - Extract multi-format archives (zip, tar, 7z) in a single codebase without format-specific libraries - Read archive contents without extracting to disk, iterating over entries and blocks for streaming processing - Create tar or zip archives programmatically with custom metadata, permissions, and timestamps - Handle archives in memory buffers or from file descriptors rather than files on disk - Process large archives with progress tracking using the bytes_read attribute ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. libarchive-c provides a Python interface to libarchive, a C library for reading, writing, and extracting archives in formats including tar, zip, 7z, and others via ctypes bindings. Yes. libarchive-c is a solid, permissively licensed wrapper with no runtime Python dependencies, low install friction, and broad archive format support. It's aging but actively maintained and carries no known vulnerabilities. Install it if you need multi-format archive handling and are comfortable with the system libarchive dependency. ## Install pip install libarchive-c uv add libarchive-c poetry add libarchive-c ## Installing libarchive-c Before you install: Installation is straightforward with no runtime dependencies beyond the system libarchive library. The package is aging (last release 449 days ago) but remains actively maintained with recent commits; compatibility is tested against Python 3.12 and 3.13. License in practice: Released under CC0 Public Domain Dedication, placing it in the permissive category with no restrictions on use, modification, or redistribution. Quickstart: pip install libarchive-c import libarchive # Extract an archive os.chdir('/path/to/target') libarchive.extract_file('test.zip') # Read an archive with libarchive.file_reader('test.tar.gz') as archive: for entry in archive: print(entry.pathname) Requires libarchive system library to be installed and accessible; on macOS with obsolete versions, set LIBARCHIVE environment variable to point to a recent installation. Verify before relying: - Whether performance is acceptable for very large archives or high-throughput scenarios - Completeness of support for all libarchive features and edge cases in the Python wrapper ## Package facts - License: CC0 (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 396.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags archive extraction python, tar zip 7z reader writer, libarchive python bindings, read write archives, multi-format archive handling, archive-formats, ctypes-binding [View on SkillFed](https://skillfed.io/packages/libarchive-c) · [View on PyPI](https://pypi.org/project/libarchive-c/)