PyForgee is a hybrid tool that combines the advantages of PyInstaller, cx_Freeze, and Nuitka with advanced compression, protection, and optimization features to create optimal Python executables.
- Automatic selection of the best compiler depending on the context
- Supports PyInstaller, Nuitka, and cx_Freeze
- Static and dynamic dependency analysis
- Adaptive optimizations depending on application type
- UPX β 50-70% executable size reduction
- LZMA/7z β High-performance resource compression
- Brotli β Optimized for web-related data
- Custom algorithms β Adaptive compression depending on content
- PyArmor β Professional-grade anti-decompilation
- Custom obfuscation β Name and string masking
- Bytecode encryption β AES-encrypted
.pycfiles - Anti-debugging β Debugger and VM detection
- Modern CLI using Rich and Click
- Intuitive GUI with PySide6 (in development)
- Flexible configuration β YAML, JSON, INI
- Extensible plugin system
- Python 3.9 or higher
- pip (Python package manager)
# Clone the repository
git clone https://github.com/PyForgee/PyForgee.git
cd PyForgee
# Install dependencies
pip install -r requirements.txt
# Install PyForgee
pip install -e .# Install with dev/docs extras
pip install -e ".[dev,docs]"
# Recommended external tools
pip install pyinstaller>=5.0
pip install nuitka>=1.5.0
pip install pyarmor>=8.0.0- UPX: Download UPX for executable compression
- PyArmor Pro: License required for advanced protection
# Basic compilation
PyForgee compile script.py
# With optimizations
PyForgee compile script.py --optimize --compress upx
# With protection
PyForgee compile script.py --protect advanced --obfuscate-names# Standard analysis
PyForgee analyze script.py
# Deep analysis with JSON export
PyForgee analyze script.py --deep --format json --output dependencies.json# UPX compression
PyForgee compress app.exe --method upx --level 9
# Multiple files in parallel
PyForgee compress *.exe --parallel --max-workers 8# Intermediate protection
PyForgee protect src/ --level intermediate
# Maximum protection
PyForgee protect script.py --level maximum --obfuscate-strings --anti-debugpreferred_compiler: auto # auto, pyinstaller, nuitka, cx_freeze
pyinstaller_path: null
nuitka_path: null
default_compression: auto # auto, upx, lzma, brotli, custom
compression_level: 9
upx_path: null
default_protection_level: intermediate # basic, intermediate, advanced, maximum
pyarmor_path: null
output_directory: "./dist"
temp_directory: null
cache_directory: null
backup_original: true
parallel_builds: true
max_workers: 4
default_excludes:
- tkinter
- unittest
- doctest
- pdb
- sqlite3PyForgee config show
PyForgee config set preferred_compiler nuitka
PyForgee config export my_config.yaml --format yaml
PyForgee config import my_config.yamlPyForgee compile gui_app.py \
--compiler pyinstaller \
--no-console \
--icon app_icon.ico \
--compress upx \
--optimizePyForgee compile server.py \
--compiler nuitka \
--protect advanced \
--obfuscate-names \
--obfuscate-strings \
--exclude tkinter unittestPyForgee batch *.py \
--config batch_config.yaml \
--parallel \
--max-workers 6 \
--output ./releasePyForgee analyze large_app.py --deep --include-stdlib
PyForgee compile large_app.py \
--exclude $(PyForgee analyze large_app.py --suggest-excludes) \
--compress auto \
--optimize- UPX Compressor β Executable compression
- PyArmor Protector β Professional code protection
- Icon Manager β Icon conversion and management
from PyForgee.plugins import BasePlugin, PluginMetadata, PluginType
class MyPlugin(BasePlugin):
def get_metadata(self):
return PluginMetadata(
name="my_plugin",
version="1.0.0",
description="My custom plugin",
plugin_type=PluginType.TOOL
)
def initialize(self, config):
return True
def execute(self, context):
return {"success": True}- Size reduction: 40β70% vs PyInstaller alone
- Build time: < 2 minutes for medium projects
- Compatibility: Windows 10/11, Linux, macOS
- Protection: Resistant to standard decompilation tools
| Application Type | Original Size | After PyForgee | Reduction |
|---|---|---|---|
| Simple CLI | 15 MB | 6 MB | 60% |
| Tkinter GUI | 45 MB | 18 MB | 60% |
| Data Science App | 120 MB | 50 MB | 58% |
PyForgee/
βββ core/
β βββ compiler_engine.py
β βββ dependency_analyzer.py
β βββ compression_handler.py
β βββ protection_manager.py
βββ gui/
βββ cli/
βββ utils/
βββ plugins/
βββ tests/
- Python 3.9+
- Click β Modern CLI framework
- Rich β Advanced terminal rendering
- PySide6 β GUI framework
- PyYAML β Config parsing
- asyncio β Async operations
pytest tests/
pytest tests/ --cov=src --cov-report=html
pytest tests/integration/
flake8 src/
black src/
mypy src/tests/
βββ unit/
β βββ test_compiler_engine.py
β βββ test_dependency_analyzer.py
β βββ test_compression_handler.py
βββ integration/
βββ fixtures/
βββ conftest.py
We welcome contributions! See CONTRIBUTING.md for details.
- π Bug fixes
- β¨ New features
- π Documentation improvements
- π§ͺ Extra tests
- π Community plugins
- Fork the project
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License β see LICENSE for details.
- PyInstaller Team β Compatibility foundation
- Nuitka Project β Performance optimizations
- UPX Team β Outstanding compression tool
- PyArmor β Professional protection solutions
- Python Community β Ecosystem and feedback
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Docs: docs.PyForgee.dev
- Email: contact@PyForgee.dev
PyForgee β Forge your Python applications into optimized executables! π