archive-extractor
Recursively extract various archive formats with auto dependency install, idempotency via marker files, and support for nested archives up to 20 levels deep.
41 downloads
Free
Reviewed
Smart Archive Extractor
This skill provides a reliable way to recursively extract archives. It supports complex logic like avoiding re-extraction of already processed files and handling nested archives (e.g., a zip containing a tar.gz).
Capabilities
- Recursive Extraction: Automatically detects archives inside extracted folders and extracts them (up to 20 levels deep).
- Idempotency: Skips extraction if a success marker (
.extracted_success) is found, unless forced. - Smart Format Support: Handles standard formats (
.zip,.tar) and complex ones (.rar,.7z) by auto-installing dependencies. - Gzip Handling: Special handling for single
.gzfiles (e.g.,data.txt.gz->data.txt/data.txt).
Usage
Run the python script located in scripts/extract.py.
Command Syntax
python3 scripts/extract.py <PATH> [OPTIONS]
Arguments
<PATH>: The target file or directory pattern to process.- Examples:
data.zip,downloads/,"*.tar.gz"(glob patterns supported).
- Examples:
Options
-f, --force: Force re-extraction even if the success marker exists. Use this if the user says "retry", "overwrite", or "force".-d, --dest <DIR>: Specify a root output directory. If omitted, archives are extracted alongside the source files.
Examples
1. Basic Extraction
Extract a single file or a directory of archives.
python3 scripts/extract.py downloads/archive.zip
# OR for a directory
python3 scripts/extract.py downloads/
2. Force Re-extraction
Use when the user suspects corruption or explicitly requests a clean start.
python3 scripts/extract.py downloads/archive.zip -f
3. Extract to Specific Folder
Use when the user wants to organize output in a separate location.
python3 scripts/extract.py downloads/ -d ./extracted_output
Error Handling
- If
patoolis missing, the script will attempt topip installit automatically. - If an archive is corrupt, it will be skipped, and the error will be logged without crashing the entire process.
- If recursion depth exceeds 20, it will stop digging deeper to prevent infinite loops.
Download
ZIP package — ready to use
Skill Info
- Creator
- qiliangzhao20241028
- Downloads
- 41
- Published
- Mar 15, 2026
- Updated
- Mar 16, 2026