What it does
Riskfolio-Lib is a Python portfolio-optimization library for students, analysts and quantitative developers. It combines several risk measures with return, utility and risk-parity objectives. The project releases the library under the BSD 3-Clause licence and provides portfolio charts and notebook or Excel reports.
Riskfolio-Lib lets you change the definition of risk as well as the optimization objective. Standard deviation describes overall variation, downside measures concentrate on losses, and drawdown measures follow declines from earlier portfolio values. Comparing these choices with the same set of assets can show why an allocation changes.
The library builds on pandas tables and CVXPY, an optimization engine. It supports limits on asset groups, turnover, tracking error and risk contributions, plus hierarchical portfolio methods. Output tools show allocations and risk contributions and can assemble reports in Jupyter or Excel.
Python 3.10 or newer is required for the current package. The public installation command is pip install riskfolio-lib, with no Riskfolio account or subscription needed. The BSD licence permits use and modification subject to its notice requirements; optional training and consulting are separate from the library.
Solver choice is part of the setup. The solver table maps each risk measure to the mathematical problem it creates. Some advanced measures are difficult for the included open solvers; the project recommends MOSEK for those cases. A free library therefore does not guarantee that every chosen solver or large optimization setup is free.
Strengths
- Supports downside and drawdown objectives alongside volatility
- Includes constraints on groups, turnover and risk contributions
- Provides portfolio visualizations and Jupyter or Excel reporting
Watch out for
- Some advanced formulations need a more capable solver than the included defaults
- The current release requires Python 3.10 or newer
Best for
- Quantitative analysts comparing different definitions of portfolio risk
- Students exploring constrained allocation and risk-parity models
Sources
- Riskfolio-Lib scope, Python requirements and installation (Oct 27, 2026)
- Riskfolio-Lib portfolio controls, reporting and solver table (Oct 27, 2026)
- Riskfolio-Lib BSD 3-Clause licence (Oct 27, 2026)
