{"id":23697,"library":"extractcode","title":"extractcode","description":"A mostly universal archive extractor using 7zip, libarchive and the Python standard library for reliable archive extraction. Current version 31.0.0, requires Python >=3.6. Released as part of the scancode-toolkit ecosystem.","status":"active","version":"31.0.0","language":"python","source_language":"en","source_url":"https://github.com/nexB/extractcode","tags":["archive","extraction","7zip","libarchive","universal"],"install":[{"cmd":"pip install extractcode","lang":"bash","label":"Install extractcode"},{"cmd":"pip install extractcode[patch]","lang":"bash","label":"Install with patch support (extra)"}],"dependencies":[],"imports":[{"note":"extract_archive is in the api submodule, not top-level.","wrong":"from extractcode import extract_archive","symbol":"extract_archive","correct":"from extractcode.api import extract_archive"}],"quickstart":{"code":"from extractcode.api import extract_archive\n\n# Extract an archive to a destination directory\nextract_archive('sample.zip', dest_dir='/tmp/extracted', verbose=True)","lang":"python","description":"Basic usage: extract an archive file to a directory."},"warnings":[{"fix":"pip install extractcode[patch]","message":"In v31.0.0, patch extraction is no longer installed by default. Use the [patch] extra to include patch.py support.","severity":"breaking","affected_versions":">=31.0.0"},{"fix":"Use `from extractcode.api import extract_archive`.","message":"The main extraction function `extract_archive` is located in the `extractcode.api` module, not in the top-level `extractcode` package. Importing from the top level will raise ImportError.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to v31.0.0 and use `from extractcode.api import extract_archive`.","message":"Older versions used `extractcode.extract()` or similar functions that are now removed. Check the API for the current interface.","severity":"deprecated","affected_versions":"<31.0.0"}],"env_vars":null,"search_vec":"'3.6':24 '31.0.0':21 '7zip':8,36 'archiv':5,17,34 'current':19 'ecosystem':33 'extract':18,35 'extractcod':1 'extractor':6 'libarch':9,37 'librari':14 'most':3 'part':27 'python':12,23 'releas':25 'reliabl':16 'requir':22 'scancod':31 'scancode-toolkit':30 'standard':13 'toolkit':32 'univers':4,38 'use':7 'version':20","created_at":"2026-05-01T08:09:09.259767+00:00","updated_at":"2026-05-01T08:09:09.259767+00:00","problems":[{"fix":"Upgrade to the latest version: pip install --upgrade extractcode","cause":"Installed an older version (<31.0.0) where the API module did not exist or was named differently.","error":"ModuleNotFoundError: No module named 'extractcode.api'"},{"fix":"from extractcode.api import extract_archive","cause":"Attempting to import directly from the top-level package instead of the api submodule.","error":"ImportError: cannot import name 'extract_archive' from 'extractcode'"},{"fix":"Use from extractcode.api import extract_archive and call extract_archive().","cause":"Using an old API (e.g., `extractcode.extract()`) that was removed in recent versions.","error":"AttributeError: module 'extractcode' has no attribute 'extract'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"31.1.0","cli_name":"extractcode","cli_version":"ExtractCode version 2021.6.2","type":"library","homepage":null,"github":"https://github.com/nexB/extractcode","docs":null,"changelog":null,"pypi":"https://pypi.org/project/extractcode/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}