A unified CLI for file extraction and compression on UNIX systems.
Features
Simple extraction: Extract files with a single command arc x file
Easy compression: Compress files and directories with arc c source
Multiple formats: Support for ZIP, TAR, GZIP, BZIP2, XZ, 7Z, and RAR formats
Dependency checking: Built-in tool to check system dependencies
Rich output: Beautiful colored output with file sizes and progress
Cross-platform: Works on any UNIX-like system (Linux, macOS, BSD)
Installation
Install Arc File Extractor using pip:
pip install arc-file-extractor
Or install from source:
git clone https://github.com/alves/arc_file_extractor.git cd arc_file_extractor pip install .
Usage
Basic Commands
Extract a file:
arc x archive.zip
arc x document.tar.gz
arc x backup.7z
This will extract the file to a directory with the same name (without extension).
Compress a file or directory:
arc c myfile.txt
arc c mydirectory/
arc c source/ -o backup.tar.gz
If no output file is specified, it defaults to creating a .zip file.
List supported formats:
arc list
Check system dependencies:
arc check
Advanced Usage
Verbose output:
arc x archive.zip -v
arc c mydir/ -v
Custom output file:
arc c myproject/ -o backup.tar.gz
arc c documents/ -o docs_backup.7z
Supported Formats
Extraction: - ZIP (.zip) - TAR (.tar, .tar.gz, .tgz, .tar.bz2, .tbz, .tar.xz, .txz) - GZIP (.gz) - BZIP2 (.bz2) - XZ (.xz) - 7-Zip (.7z) - RAR (.rar)
Compression: - ZIP (.zip) - TAR (.tar, .tar.gz, .tgz, .tar.bz2, .tbz, .tar.xz, .txz) - 7-Zip (.7z) - RAR (.rar)
Dependencies
Arc File Extractor uses system tools for compression and extraction. Install the required tools:
Ubuntu/Debian:
sudo apt install unzip tar gzip bzip2 xz-utils p7zip-full unrar zip
Fedora/RHEL:
sudo dnf install unzip tar gzip bzip2 xz p7zip unrar zip
Arch Linux:
sudo pacman -S unzip tar gzip bzip2 xz p7zip unrar zip
macOS:
brew install p7zip unrar zip
Examples
Extract various archive types:
# Extract a ZIP file
arc x project.zip
# Creates: project/ directory
# Extract a TAR.GZ file
arc x backup.tar.gz
# Creates: backup/ directory
# Extract with verbose output
arc x large_archive.7z -v
Compress files and directories:
# Compress a directory to ZIP (default)
arc c myproject/
# Creates: myproject.zip
# Compress to TAR.GZ
arc c documents/ -o docs.tar.gz
# Compress a single file
arc c important_file.txt -o compressed.7z
Check system status:
# Check what tools are installed
arc check
# List all supported formats
arc list
Development
To set up for development:
git clone https://github.com/alves/arc_file_extractor.git cd arc_file_extractor pip install -e .[dev]
Run tests:
pytest
API Reference
Core Classes
ArcFileExtractor
Main class for file extraction and compression operations.
from arc_file_extractor import ArcFileExtractor
extractor = ArcFileExtractor()
# Extract a file
result = extractor.extract("archive.zip")
# Compress a file/directory
result = extractor.compress("source_dir", "output.tar.gz")
Methods:
extract(file_path: str) -> int: Extract a file to a directory with the same name
compress(source_path: str, output_file: str = None) -> int: Compress a file or directory
Utility Functions
check_dependencies() -> List[str]
Check if required external tools are installed. Returns a list of missing dependencies.
get_supported_formats() -> dict
Get supported file formats for extraction and compression.
validate_file_path(file_path: str) -> bool
Validate if a file path exists and is readable.
get_file_size(file_path: str) -> str
Get human-readable file size.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create a feature branch
Make your changes
Add tests for new functionality
Run the test suite
Submit a pull request
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
Metadata
Release files for arc-file-extractor 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arc_file_extractor-0.1.0.tar.gz | 15.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arc_file_extractor-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.9 kB
Release files / arc_file_extractor-0.1.0.tar.gz
| Download URL | arc_file_extractor-0.1.0.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aff6ca36ab54b05ffc85355f7d71ea0f536f36a80caa024c28b5cbcab6b27770
|
|
BLAKE2b-256 checksum How to use checksums |
74bb73e80b8abb02d84f724123f59f1e4b0a72e2f717994f8342190f8960ea29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / arc_file_extractor-0.1.0-py3-none-any.whl
| Download URL | arc_file_extractor-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
51695b896d7cbff3605def812f6f72f88fa28f7efd7f4df478d6c90e2ec399ca
|
|
BLAKE2b-256 checksum How to use checksums |
4fdec3936524ccb7a62812ee6b774bedcd9af21ef6d7a62c9e9268522774a04d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|