AlphaPy Pro is an advanced machine learning framework designed for speculators and data scientists. Building on the foundation of the original AlphaPy, this professional edition offers enhanced features, improved performance, and enterprise-grade capabilities for financial modeling and prediction.
Written in Python with scikit-learn, pandas, and many other powerful libraries, AlphaPy Pro provides a comprehensive toolkit for feature engineering, model development, and portfolio analysis.
- 📦 Package: Ready for PyPI publication (alphapy-pro)
- 📚 Documentation: Live on GitHub Pages
- 🐍 Python: Requires 3.12+ (modern Python features)
- 🔄 Development: Actively maintained and enhanced
- MetaLabeling Support: Advanced financial ML labeling techniques
- NLP Features: Natural language processing for sentiment analysis
- Enhanced MarketFlow: Improved financial data pipeline
- Modern Packaging: Built with
uvfor faster dependency management - Python 3.12+: Leverages latest Python performance improvements
- Advanced ML Pipeline: Run machine learning models using
scikit-learn,XGBoost,LightGBM, andCatBoost - Ensemble Methods: Generate sophisticated blended and stacked ensembles
- MarketFlow: Specialized pipeline for financial market analysis and trading system development
- Portfolio Analysis: Comprehensive trading system backtesting and portfolio optimization
- Configuration-Driven: Flexible YAML-based configuration system
- Feature Engineering: Advanced feature creation, selection, and transformation tools
- Time Series Support: Built-in support for time series forecasting and analysis
- alphapy/: Main package with core ML functionality
- config/: YAML configuration files for algorithms, features, and systems
- projects/: Individual project workspaces with isolated configurations
- docs/: Comprehensive documentation and tutorials
- Data Ingestion: Load and preprocess data from various sources
- Feature Engineering: Create, transform, and select features
- Model Training: Train and optimize multiple ML algorithms
- Ensemble Creation: Combine models for improved performance
- Evaluation: Generate comprehensive performance metrics and visualizations
- Deployment: Export models and predictions for production use
# Install the latest stable version
pip install alphapy-pro
# Or using uv (faster)
uv pip install alphapy-pro
# Install with optional dependencies
pip install alphapy-pro[dev,docs]# Clone the repository
git clone https://github.com/ScottFreeLLC/alphapy-pro.git
cd alphapy-pro
# Using uv (recommended - faster)
uv pip install -e .[dev]
# Or using pip
pip install -e .[dev]# Build and install using modern packaging
python -m build
pip install dist/alphapy_pro-*.whl-
Copy configuration templates:
cd config cp alphapy.yml.template alphapy.yml cp sources.yml.template sources.yml -
Edit configurations:
- Update
alphapy.ymlwith your local directory paths - Add your API keys to
sources.yml(keep this file secure!)
- Update
-
See
config/README.mdfor detailed setup instructions
# Main pipeline
alphapy
# Market analysis pipeline
mflowalphapy-pro/
├── alphapy/ # Core package
│ ├── alphapy_main.py # Main pipeline entry point
│ ├── mflow_main.py # Market flow pipeline
│ ├── model.py # Model management
│ ├── features.py # Feature engineering
│ └── ...
├── config/ # Configuration files
│ ├── alphapy.yml # Main configuration (user-specific)
│ ├── sources.yml # API keys (user-specific, gitignored)
│ ├── algos.yml # ML algorithm definitions
│ ├── variables.yml # Feature definitions
│ └── ...
├── projects/ # Project workspaces
│ ├── kaggle/ # Kaggle competition example
│ ├── time-series/ # Time series analysis
│ └── ...
└── docs/ # Documentation
AlphaPy Pro uses a comprehensive YAML-based configuration system:
config/alphapy.yml: Main configuration with project pathsconfig/sources.yml: API keys for data sources⚠️ Keep Secret!config/algos.yml: ML algorithm definitions and hyperparametersconfig/variables.yml: Feature variable definitionsconfig/groups.yml: Variable groupings for feature engineeringconfig/systems.yml: Trading system definitionsprojects/*/config/model.yml: Project-specific model configurations
Specialized pipeline for financial market analysis featuring:
- Multi-source data integration (EOD Historical Data, Finnhub, IEX, Polygon, etc.)
- Advanced technical indicators and market features
- Trading system development and backtesting
- Portfolio optimization and risk analysis
- Real-time prediction capabilities
AlphaPy Pro supports multiple data providers:
- EOD Historical Data: Historical market data
- Finnhub: Real-time market data and news
- IEX Cloud: Financial data platform
- Polygon: Stock market data API
- Yahoo Finance: Free market data
- Custom sources: Easily integrate your own data
cd projects/kaggle
alphapycd projects/time-series
alphapycd projects/your-market-project
mflow📚 Live Documentation: https://scottfreellc.github.io/alphapy-pro/
Documentation is automatically built and deployed via GitHub Actions. It covers:
- Installation and setup
- Configuration guide
- Feature engineering
- Model development
- Trading systems
- API reference
# Using uv
uv pip install sphinx sphinx-rtd-theme
cd docs
make html
# Or using pip
pip install sphinx sphinx-rtd-theme
cd docs
make html# Install documentation dependencies
uv pip install sphinx sphinx-rtd-theme sphinx-autodoc-typehints
# Build documentation
cd docs
make html./utils/cleanup_runs.sh# Run tests with pytest
pytest
# Run tests with coverage
pytest --cov=alphapy --cov-report=html
# Run specific test files
pytest tests/test_version.py -v- Python 3.12+ (Latest Python features and performance)
- pandas: Data manipulation and analysis
- scikit-learn: Machine learning algorithms
- NumPy: Numerical computing
- PyYAML: Configuration file parsing
- matplotlib: Plotting and visualization
- seaborn: Statistical data visualization
- pytest: For running tests (install with
uv pip install alphapy-pro[test]) - black, isort, flake8: Code quality tools (install with
uv pip install alphapy-pro[dev]) - sphinx: Documentation building (install with
uv pip install alphapy-pro[docs])
We welcome contributions to AlphaPy Pro! Here's how you can help:
- Fork the repository and create your feature branch from
main - Make your changes following the existing code style
- Add tests for any new functionality
- Update documentation if needed
- Submit a pull request with a clear description of your changes
# Clone your fork
git clone https://github.com/ScottFreeLLC/alphapy-pro.git
cd alphapy-pro
# Install in development mode with all dev dependencies
uv pip install -e .[dev]
# Install pre-commit hooks
pre-commit install
# Set up configuration
cd config
cp alphapy.yml.template alphapy.yml
cp sources.yml.template sources.yml
# Edit with your settingsThis project uses several tools to maintain code quality:
# Format code with black
black .
# Sort imports with isort
isort .
# Check code style with flake8
flake8 .
# Run type checking with mypy
mypy alphapy/
# Run all pre-commit hooks
pre-commit run --all-files- Follow PEP 8 style guidelines (enforced by flake8)
- Use black for code formatting
- Add docstrings to new functions and classes
- Include type hints where appropriate
- Write tests for new functionality
- Update CLAUDE.md if adding new development commands
AlphaPy Pro is licensed under the Apache License 2.0. See LICENSE for details.
- Issues: Open an issue on GitHub for bug reports and feature requests
- Documentation: Check the
docs/directory for comprehensive guides - Configuration: See
config/README.mdfor setup help
If you find AlphaPy Pro valuable for your work, please consider supporting its development:
- GitHub Sponsors: Sponsor this project
- Buy Me a Coffee: Support ongoing development
- PayPal: Direct donations welcome
Your support helps maintain and improve AlphaPy Pro for the entire community.
AlphaPy Pro builds upon the foundation of the original AlphaPy framework, incorporating lessons learned and feature requests from the community. Special thanks to all contributors and users who have helped shape this professional edition.
AlphaPy Pro - Professional Machine Learning for Financial Markets and Beyond