PyPortfolio/PyPortfolioOpt
Financial portfolio optimization in python, including classical efficient frontier, Black-Litterman, Hierarchical Risk Parity observed · 2026-08-28
Health v2 · maintenance only
75/100
- Activity 91
- Release rhythm 40
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 3018
- days_rel: 188
- days_push: 57
- n_releases_24m: 1
Adoption not part of the score
5983 stars · 1171 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
PyPortfolioOpt is a Python library for financial portfolio optimization, implementing classical mean-variance optimization, Black-Litterman allocation, covariance shrinkage, and Hierarchical Risk Parity. It is designed in the spirit of scikit-learn to be extensive yet easily extensible for both casual investors and professional quants prototyping allocation strategies.
Use cases
- compute the efficient frontier for a basket of stocks
- optimize portfolio weights to maximize Sharpe ratio
- apply Black-Litterman allocation with my own views
- run Hierarchical Risk Parity on asset returns
- combine multiple alpha sources into risk-efficient weights
- shrink a sample covariance matrix for more stable estimates
- prototype portfolio allocation strategies in Python
When to choose
- you need well-tested portfolio optimization methods in Python with a scikit-learn-like API
- you want classical MPT, Black-Litterman, and HRP in one library
- you are prototyping allocation strategies or teaching quantitative finance
- you want a permissively licensed (MIT) library with good documentation
When to avoid
- you need live market data feeds or backtesting engines - pair it with other tools
- you require high-frequency or execution-level trading infrastructure
- you need non-Python environments or GPU-accelerated large-scale optimization
Facets
library · maturity stable
math data-science trading fintech data-science mathematics python cross-platform portfolio-optimization quantitative-finance efficient-frontier black-litterman hierarchical-risk-parity mean-variance investing
2 sources
- readme: https://github.com/PyPortfolio/PyPortfolioOpt · fetched 2026-08-28 · 9469ab019abf
- registry_pypi: https://pypi.org/pypi/pyportfolioopt/json · fetched 2026-08-29 · 601b78bdb7f9
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| PyPortfolio/PyPortfolioOpt | main | 75 |
For agents
markdown · JSON · MCP: product_card(name="PyPortfolio/PyPortfolioOpt")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem