Home / Risk & portfolio

PyPortfolioOpt

Risk & portfolio★ 6,091 GitHub starsJupyter Notebook⏱ Last commit 3 months ago

Mean-variance, Black-Litterman and risk-parity portfolio optimization in Python

What it is

A Python library implementing financial portfolio optimization methods, spanning classical mean-variance optimization on the efficient frontier as well as Black-Litterman allocation, shrinkage estimators, and Hierarchical Risk Parity. Concretely, it estimates expected returns and covariance risk models, optimizes objective functions such as maximizing the Sharpe ratio, supports adding constraints or custom objectives, and can convert continuous weights into an actual allocation for a given portfolio size and recent prices. Inspired by scikit-learn, it is extensive yet easily extensible, making it a fit for casual investors as well as professionals seeking a prototyping tool for combining alpha sources in a risk-efficient way. Keep in mind that nothing in the project constitutes investment advice, and users remain responsible for their own investment decisions.

At a glance

RecommendedOur rating, based on popularity, maintenance and how ready it is for real use.

Best forProfessional quants
Used forData analysis, Strategy research
MarketsMulti-market
StackPython
Learning curveModerate learning curve
Practical valueHigh practical value
CostFree and open source
HardwareNo GPU needed
MaintenanceLast commit 3 months ago

GitHub stars, last 30 days

Daily snapshots since 2026-09-12 (up to 30 days): +68 over the period, now 6,091. Gaps mean no snapshot was taken that day.

In the author's words

Financial portfolio optimization in python, including classical efficient frontier and advanced methods.

Open on GitHub ↗This week's trending tools中文页面

Similar tools