AlphaPy Pro: A Machine Learning Pipeline for Speculators
Project description
AlphaPy Pro
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.
๐ Project Status
- ๐ฆ Package: Ready for PyPI publication (alphapy-pro)
- ๐ Documentation: Live on GitHub Pages
- ๐ Python: Requires 3.12+ (modern Python features)
- ๐ Development: Actively maintained and enhanced
โจ What's New in AlphaPy Pro
- 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
Key Features
- 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
Architecture
Core Components
- 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
Pipeline Flow
- 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
Quick Start
Installation
From PyPI (Recommended)
# 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]
Development Installation
# 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]
From Source
# Build and install using modern packaging
python -m build
pip install dist/alphapy_pro-*.whl
Configuration Setup
-
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
Running AlphaPy Pro
# Main pipeline
alphapy
# Market analysis pipeline
mflow
Project Structure
alphapy-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
Configuration System
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
MarketFlow
Specialized pipeline for financial market analysis featuring:
- Multi-source data integration (EOD Historical Data, Polygon, Yahoo Finance)
- Advanced technical indicators and market features
- Trading system development and backtesting
- Portfolio optimization and risk analysis
- Real-time prediction capabilities
Data Sources
AlphaPy Pro supports multiple data providers:
- EOD Historical Data: Historical market data
- Polygon: Stock market data API
- Yahoo Finance: Free market data
Examples
Kaggle Competition
cd projects/kaggle
alphapy
Time Series Analysis
cd projects/time-series
alphapy
Market Analysis
cd projects/your-market-project
mflow
Documentation
๐ 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
Building Documentation Locally
# 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
Development
Build Documentation
# Install documentation dependencies
uv pip install sphinx sphinx-rtd-theme sphinx-autodoc-typehints
# Build documentation
cd docs
make html
Clean Up Old Runs
./utils/cleanup_runs.sh
Testing
# 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
Requirements
- 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
Optional Dependencies
- 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])
Contributing
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
Development Setup
# 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 settings
Code Quality
This 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
Code Guidelines
- 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
License
AlphaPy Pro is licensed under the Apache License 2.0. See LICENSE for details.
Support
- 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
Donations
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.
Acknowledgments
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alphapy_pro-3.1.1.tar.gz.
File metadata
- Download URL: alphapy_pro-3.1.1.tar.gz
- Upload date:
- Size: 6.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99c24fa3a7c56b4c75c3b1552722f45c2ad0ed445042433dded3635caa9ad0f9
|
|
| MD5 |
63c308d17d15dd73b9d767bf6d30ed9c
|
|
| BLAKE2b-256 |
6ba7f5e94e92495f0f023021d0ce48215ea29b6326c8e63266cbb48adb25031d
|
Provenance
The following attestation bundles were made for alphapy_pro-3.1.1.tar.gz:
Publisher:
release.yml on ScottfreeLLC/alphapy-pro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
alphapy_pro-3.1.1.tar.gz -
Subject digest:
99c24fa3a7c56b4c75c3b1552722f45c2ad0ed445042433dded3635caa9ad0f9 - Sigstore transparency entry: 1391687194
- Sigstore integration time:
-
Permalink:
ScottfreeLLC/alphapy-pro@3dd1c97df168ef743a89402f2b39646c547ec1f1 -
Branch / Tag:
refs/tags/v3.1.1-monolith - Owner: https://github.com/ScottfreeLLC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3dd1c97df168ef743a89402f2b39646c547ec1f1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file alphapy_pro-3.1.1-py3-none-any.whl.
File metadata
- Download URL: alphapy_pro-3.1.1-py3-none-any.whl
- Upload date:
- Size: 463.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b5d23979822ee6dc3f03fddc57d6953db01ad12c9aebb74a791179c7b371b9e
|
|
| MD5 |
a4eba9a0f2b0ffbccc2fed601d1fa178
|
|
| BLAKE2b-256 |
c94eac4ba7f8bb3e9eb8228d45781d2985ecb460a2e515744b60bd0b53980db3
|
Provenance
The following attestation bundles were made for alphapy_pro-3.1.1-py3-none-any.whl:
Publisher:
release.yml on ScottfreeLLC/alphapy-pro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
alphapy_pro-3.1.1-py3-none-any.whl -
Subject digest:
7b5d23979822ee6dc3f03fddc57d6953db01ad12c9aebb74a791179c7b371b9e - Sigstore transparency entry: 1391687196
- Sigstore integration time:
-
Permalink:
ScottfreeLLC/alphapy-pro@3dd1c97df168ef743a89402f2b39646c547ec1f1 -
Branch / Tag:
refs/tags/v3.1.1-monolith - Owner: https://github.com/ScottfreeLLC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3dd1c97df168ef743a89402f2b39646c547ec1f1 -
Trigger Event:
push
-
Statement type: