EzCompiler
EzCompiler is a professional Python library for compiling projects into executable files with automatic version management, packaging, and distribution. It provides a unified interface for multiple compilers (Cx_Freeze, PyInstaller, Nuitka) with modular architecture and complete type hints.
📦 Installation
# With uv (recommended)
uv add ezcompiler
# With pip
pip install ezcompiler
Or from source:
git clone https://github.com/neuraaak/ezcompiler.git
cd ezcompiler
uv pip install -e . # uv
pip install -e . # pip
The unreleased main branch can also be installed directly:
uv pip install git+https://github.com/neuraaak/ezcompiler.git
pip install git+https://github.com/neuraaak/ezcompiler.git
🚀 Quick Start
from ezcompiler import EzCompiler
# Initialize
compiler = EzCompiler()
# Configure project
compiler.init_project(
version="1.0.0",
project_name="MyApp",
main_file="main.py",
include_files={"files": [], "folders": []},
output_folder="dist",
)
# Run the full build pipeline with DLP progress display
# (version, compile, zip, installer, TUF release — all local)
compiler.run_pipeline(console=True)
Publication is a separate, deliberate CLI step:
# Publication is a separate CLI step: it reads your ezcompiler.yaml / pyproject.toml
ezcompiler publish release --release-destination disk --destination ./releases
🎯 Key Features
- ✅ Multi-Compiler Support: Cx_Freeze, PyInstaller, and Nuitka with unified interface
- ✅ Automatic File Generation: Version files,
build.pyscripts, and configuration from templates - ✅ Template System: Flexible file generation based on customizable templates
- ✅ Packaging: Automatic ZIP archive creation for distribution
- ✅ Publication:
ezcompiler publishto local disk, HTTP/HTTPS servers, R2 or GitHub Releases, with a recap and confirmation before irreversible steps - ✅ Configuration Management: Centralized configuration with automatic validation
- ✅ Structured Logging: Integration with Ezpl for professional logging
- ✅ Full Type Hints: Complete typing support for IDEs and linters
📚 Documentation
Complete documentation is available at neuraaak.github.io/ezcompiler
- Getting Started – Installation, basic usage, and first steps
- API Reference – Complete API documentation with examples
- CLI Reference – Command-line interface guide
- User Guides – Configuration, development, and testing guides
- Examples – Practical examples and demonstrations
🧪 Testing
Comprehensive test suite with 999 test cases covering unit, integration, and robustness scenarios (82.85% branch coverage, CI gate at 70%).
# Install dev dependencies
uv sync --all-extras --group dev
# Run all tests
pytest tests/
# Run specific test types
python tests/run_tests.py --type unit
python tests/run_tests.py --type integration
python tests/run_tests.py --type robustness
# With coverage
python tests/run_tests.py --coverage
See Development Guide for testing details.
🛠️ Development Setup
For contributors and developers:
# Install in development mode with all dependencies
uv sync --all-extras --group dev
# Run tests
pytest tests/
# Run linting and formatting
ruff check .
ruff format --check .
ty check src/ezcompiler/
pyright src/ezcompiler/
PYTHONPATH=src lint-imports
🎨 Main Components
EzCompiler: Main facade class for orchestrating the entire compilation processCompilerConfig: Centralized configuration managementCompilationResult: Result type for compilation operations (shared layer)PipelineService: Full compile → zip → upload pipeline orchestrationCompilerService: Compiler selection and executionConfigService: Configuration loading with cascade mergeTemplateService: Template processing and file generationCompilerFactory: Factory for creating compiler instancesBaseCompiler: Abstract base class for compiler adaptersCxFreezeCompiler: Cx_Freeze compiler implementationPyInstallerCompiler: PyInstaller compiler implementationNuitkaCompiler: Nuitka compiler implementation (standalone & onefile)BaseFileWriter/DiskFileWriter: File writer port and disk adapterBaseUploader: Abstract base class for uploader adaptersDiskUploader: Local disk uploaderServerUploader: HTTP/HTTPS uploader
📦 Dependencies
| Package | Version | Description |
|---|---|---|
| cx_Freeze | 7.0-9.0 | Python to executable compiler |
| PyInstaller | 5.0+ | Python to executable compiler |
| Nuitka | 2.4+ | Python to executable compiler |
| InquirerPy | 0.3.4+ | Interactive CLI interface |
| requests | 2.32.3+ | HTTP library for uploads |
| PyYAML | 6.0+ | YAML file processing |
| click | 8.0.0+ | CLI framework |
| ezplog | 1.0.0+ | Structured logging framework |
🔧 Quick API Reference
from ezcompiler import EzCompiler, CompilerConfig
# Create compiler instance
compiler = EzCompiler()
# Initialize project
compiler.init_project(
version="1.0.0",
project_name="MyApp",
main_file="main.py",
include_files={"files": ["config.yaml"], "folders": ["assets"]},
output_folder="dist",
)
# Run full pipeline with DLP progress (version, compile, zip, installer, release)
compiler.run_pipeline(console=True)
# Or call individual steps manually:
# compiler.generate_version_file()
# compiler.compile_project(compiler="Nuitka")
# compiler.zip_compiled_project()
The Python API never publishes. Use the CLI afterwards:
ezcompiler publish update (TUF update tree) and ezcompiler publish release
(installer + ZIP). EzCompiler.upload() is deprecated and will be removed in v5.
🛡️ Robustness
EzCompiler is designed for production use with comprehensive error handling:
- Full type hints for IDE support and static analysis
- Robust error handling with specific exceptions
- Automatic validation of configuration
- Cross-platform file operations
- Support for various file encodings and special characters
💻 CLI Usage
# Create a YAML configuration file
ezcompiler init yaml
# Generate configuration
ezcompiler generate config \
--project-name "MyApp" \
--version "1.0.0" \
--main-file "main.py"
# Generate build.py
ezcompiler generate build --config ezcompiler.yaml
# Generate a version file
ezcompiler generate template --type version
# Generate templates
ezcompiler generate template --type config --mockup
# Publish the TUF update tree, then the release
ezcompiler publish update
ezcompiler publish release
See CLI Reference for complete reference.
🔄 Configuration
YAML Configuration
version: "1.0.0"
project_name: "MyApp"
main_file: "main.py"
output_folder: "dist"
include_files:
files:
- "config.yaml"
folders:
- "assets"
packages:
- "requests"
- "pandas"
excludes:
- "debugpy"
- "test"
compilation:
compiler: "auto" # "auto", "Cx_Freeze", "PyInstaller", or "Nuitka"
console: true
zip_needed: true
repo_needed: false
See Configuration Guide for detailed configuration options.
📊 Architecture
ezcompiler/
├── interfaces/ # CLI and Python API (entry points)
├── services/ # Business logic orchestration
│ ├── compiler_service.py
│ ├── config_service.py
│ ├── pipeline_service.py
│ ├── template_service.py
│ └── uploader_service.py
├── adapters/ # Concrete compiler and uploader implementations
│ ├── cx_freeze_compiler.py
│ ├── pyinstaller_compiler.py
│ ├── nuitka_compiler.py
│ ├── compiler_factory.py
│ ├── disk_file_writer.py
│ ├── disk_uploader.py
│ └── server_uploader.py
├── shared/ # Configuration, result types and exceptions
│ ├── compiler_config.py
│ └── compilation_result.py
├── utils/ # Utility functions
└── assets/templates/ # Template files (build, config, installer, updater, version)
assets/ is a dedicated resource layer for non-executable project artifacts
(template files, static generation resources). It is consumed by services
through template loaders and remains isolated from business orchestration logic.
🚀 Use Cases
Python Project Compilation
- Create Windows executables from Python scripts
- Package projects with dependencies
- Automatically generate configuration files
Automated Distribution
- Create ZIP archives for distribution
- Automatic upload to local or remote repositories
- Version management and metadata handling
Development Tools
- Generate
build.pypipeline scripts for repeatable builds - Create Windows version information files
- Automate build workflows
Project Management
- Centralized configuration via YAML/JSON files
- Customizable templates for file generation
- Integration into CI/CD pipelines
🤝 Contributing
- Clone the repository (
git clone https://github.com/neuraaak/ezcompiler.git) - Create a feature branch (
git checkout -b feat/ma-feature) - Commit your changes
- Submit a Pull Request for internal review
- Review is handled through pull requests
⭐ Support
- 🐛 Bug Reports: GitHub Issues
- 💡 Feature Requests: GitHub Issues
- 📚 Documentation: Complete Documentation
📝 License
MIT License – See LICENSE file for details.
👥 Ownership
Maintained by Neuraaak.
- Contact: floriansalort@gmail.com
🔗 Links
- Repository: https://github.com/neuraaak/ezcompiler
- Issues: GitHub Issues
- Documentation: https://neuraaak.github.io/ezcompiler/
EzCompiler – Professional Python project compilation and distribution. 🚀
Metadata
Release files for ezcompiler 4.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ezcompiler-4.1.3.tar.gz | 273.9 kB | Without provenance | Details for ezcompiler-4.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ezcompiler-4.1.3-py3-none-any.whl | Python 3 | none | any | Details for ezcompiler-4.1.3-py3-none-any.whl |
Total release size: 459.6 kB
Release files / ezcompiler-4.1.3.tar.gz
| Download URL | ezcompiler-4.1.3.tar.gz |
|---|---|
| Size | 273.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af3f931e688a16453a75c9ed020051d58b4a29dc6ee77aecd118ba01989aaed8
|
|
BLAKE2b-256 checksum How to use checksums |
67d7afa4f0f5ca10f6a73c465983d731517fbfbcb28f9679408afad1d42426c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / ezcompiler-4.1.3-py3-none-any.whl
| Download URL | ezcompiler-4.1.3-py3-none-any.whl |
|---|---|
| Size | 185.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5c1f143193fe382313fcd9e299655b4ecd01c3321a066608dfecde86211d5b78
|
|
BLAKE2b-256 checksum How to use checksums |
b0b3d555a49f6b7216e87f4bed872fd2d50948c0760339509028925b6ad2046d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for ezcompiler 4.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.