{"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,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","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,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}