extractcode
A mostly universal archive extractor using 7zip, libarchive and the Python standard library for reliable archive extraction.
What it is and what it does
ExtractCode is a universal archive extractor that handles a large number of formats—including tar, zip, 7z, rpm, deb, iso, vmdk, qcow2, and compressed variants—with built-in resilience for edge cases that cause other extractors to fail. It uses a voting system based on file extension, mimetype, and content to select the best extraction method, and can recursively extract nested archives. Behind the scenes it combines the Python standard library, a ctypes binding to libarchive, and the 7zip command-line tool to achieve broad format support.
The package is designed primarily for software composition analysis and forensic file inspection rather than preserving exact filesystem semantics. It will auto-rename files with invalid names on certain filesystems, handle multiple copies of the same path in a tar archive, extract from damaged archives when possible, fix permission issues, and skip special files and symlinks. On Linux, it can also extract VM images via libguestfs. Installation can be minimal (relying on system tools) or full (bundling binaries), and configuration is done via environment variables or plugins.
Use it for:
- Extract Linux kernel tarballs on Windows without path case-sensitivity or collision errors.
- Recover files from partially damaged or corrupted archives when standard tools fail.
- Recursively extract nested archives (tar.gz inside zip inside tar) in a single operation.
- Analyze software packages (rpm, deb, iso) as part of a supply-chain or forensic workflow.
- Extract VM disk images (vmdk, qcow2, vhd) on Linux with libguestfs support.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Extracts a wide range of archive formats (tar, zip, 7z, rpm, deb, iso, vmdk, qcow2, and many others) with fallback strategies to handle damaged archives, case-sensitivity issues, duplicate paths, and permission problems that would cause other extractors to fail.
Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real problem—extracting archives that fail with standard tools. The Apache-2.0 license is permissive. Install it if you need robust, cross-platform archive extraction with fallback strategies for edge cases; skip it if you only handle simple, well-formed archives with standard tools.
Install
extractcode on PyPI
pip
pip install extractcodeuv
uv add extractcodepoetry
poetry add extractcodeInstalling extractcode
Before you install
Low friction install with a pure-Python wheel. Marked as active with recent commits. The package offers two installation modes: `pip install extractcode[full]` bundles 7zip and libarchive binaries; `pip install extractcode` expects system-provided tools or plugin-supplied paths via environment variables.
License in practice
Apache-2.0 is permissive and imposes no restrictions on use or redistribution in closed-source projects. You may use this package freely in commercial or proprietary work.
Quickstart
pip install extractcode[full]
from extractcode import extract
extract.extract('/path/to/archive.tar.gz', '/output/directory')
Requires Python >=3.10. The `[full]` extra installs bundled 7zip and libarchive; without it, you must provide libarchive 3.5.x and 7zip 16.5.x via system PATH, environment variables (EXTRACTCODE_LIBARCHIVE_PATH, EXTRACTCODE_7Z_PATH), or plugins.
Verify before relying
- Whether the package's recursive archive-in-archives extraction works with all supported formats or has known limitations.
- Performance characteristics when extracting very large archives or deeply nested structures.
- Exact behavior of file renaming and permission changes during extraction in edge cases.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — attrs, commoncode, plugincode, typecode |
| Maintenance | actively maintained — 88 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 123,883/month — #11,892 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: extractcode-31.1.0-py3-none-any.whl
Keywords: utilities, archive, extraction, libarchive, 7zip, 7z, gzip, bzip2, xz, lzma, lz4, lzip, zstd, Z, tar, xar, ar, cpio, vmdk, qcow2, vhd, iso, deb, cab, rpm, patch, scancode-toolkit
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
commoncodeCommonCode provides utility functions for…
unclear · top 15,000 on PyPI
extractcode-7zProvides a prebuilt native 7z binary as a…
copyleft · top 15,000 on PyPI
fastdownloadDownloads, verifies, and extracts archives from…
permissive · top 15,000 on PyPI
libarchive-clibarchive-c provides a Python interface to…
permissive · top 15,000 on PyPI
maco-extractorMaco is a framework for standardizing malware…
permissive · top 15,000 on PyPI
pyunpackUnpacks archive files in Python with support…
permissive · top 15,000 on PyPI
extractcode-libarchiveProvides a prebuilt native libarchive binary as…
permissive · top 15,000 on PyPI
arParses and reads ar archive files (.a),…
permissive · top 15,000 on PyPI
patoolPatool is a command-line archive manager that…
copyleft · top 5,000 on PyPI
conda-package-handlingCreate, extract, and convert conda packages in…
permissive · top 15,000 on PyPI