PyPortfolioOpt — Portfolio Optimization
A Python library implementing classical and modern portfolio optimization: efficient frontier, Black-Litterman, HRP, and advanced risk models.
PyPortfolioOpt
PyPortfolioOpt is a popular Python library for financial portfolio optimization and risk management. It implements the full workflow — from expected-returns and covariance estimation through mean-variance optimization — giving quants and researchers a clean, well-documented toolkit for constructing risk-aware portfolios.
Key features
- Classical efficient-frontier (mean-variance) optimization with custom constraints
- Robust covariance/risk models: Ledoit-Wolf shrinkage, semicovariance, EWMA
- Black-Litterman allocation blending investor views with market equilibrium
- Hierarchical Risk Parity (HRP) and CVaR/CDaR objective functions
- Post-processing to convert continuous weights into discrete share allocations
A typical flow estimates expected_returns and a risk_model, then uses EfficientFrontier to maximize Sharpe or minimize volatility subject to constraints, returning portfolio weights ready to trade or analyze.
Curated mirror of the open-source PyPortfolioOpt (MIT). Get it from the source.