skillfed

extractcode

A mostly universal archive extractor using 7zip, libarchive and the Python standard library for reliable archive extraction.

extractcode v31.1.0 123.9K downloads/30d#11,892 on PyPI39
Permissive license Apache-2.0 Active released

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 extractcode

uv

uv add extractcode

poetry

poetry add extractcode

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyTopic :: Software DevelopmentTopic :: Utilities

Tags

archive extraction libraryuniversal archive extractorextract tar zip 7zlibarchive python wrapperhandle damaged archivesrecursive archive extractioncross-platform file extraction
archive-extractionforensicscross-platform

More Software Development packages