Professional Python .7z Archive Utility
Migrated from the powerful bit7z C++ library
NinjaZipPy is a fast, reliable Python utility for creating and extracting .7z archives. It provides a clean, professional command-line interface with comprehensive functionality for .7z archive operations.
- 🚀 Fast .7z compression and extraction
- 🔐 Password protection support
- 📊 Multiple compression levels (0-9)
- 🎯 Pattern-based file selection
- 📋 Archive information and testing
- 💻 Professional CLI with progress bars
- 🔍 Selective extraction capabilities
- ⚡ Pure Python implementation (no external dependencies)
- Python 3.7 or higher
- Windows, macOS, or Linux
git clone https://github.com/yourusername/NinjaZipPy.git
cd NinjaZipPy
pip install -e .NinjaZipPy automatically installs these dependencies:
py7zr>=0.20.0- Pure Python 7z implementationclick>=8.0.0- Command-line interface framework
# Using Python module syntax
python -m ninjazipy.cli.main compress archive.7z path\to\file1.txt path\to\folder2# Using Python module syntax
python -m ninjazipy.cli.main extract archive.7z [Output_Folder]# List files without extracting
ninjazipy extract archive.7z --list
# Using Python module syntax
python -m ninjazipy.cli.main test archive.7z# Using Python module syntax
python -m ninjazipy.cli.main test archive.7z# 1. Install in development mode
pip install -e .
# 2. Run basic functionality tests
python test_basic1.py
python test_basic2.py
# 3. Check CLI help
ninjazipy --help
# 4. Alternative execution method
python -m ninjazipy.cli.main --helpninjazipy info [OPTIONS] ARCHIVE_PATH
Options:
-v, --verbose Show detailed file listing
--help Show help messageninjazipy test [OPTIONS] ARCHIVE_PATH
Options:
-p, --password TEXT Password for encrypted archive
--help Show help message# Solution: Provide password with -p flag
ninjazipy extract -p yourpassword archive.7z# Solution: Ensure write permissions to output directory
# Or use --overwrite flag to replace existing files
ninjazipy extract archive.7z ./output/ --overwrite# NinjaZipPy automatically handles long paths using pathlib
# No additional configuration needed-
Use appropriate compression levels:
- Level 0-3: Faster compression, larger files
- Level 5-6: Balanced (recommended)
- Level 7-9: Maximum compression, slower
-
For large archives:
- Use verbose mode to monitor progress
- Ensure sufficient disk space (2x archive size)