Tools · SPBoucher
Menu

Riskfolio-Lib

by Dany Cajas · Library · also known as riskfolio

Python library for quantitative portfolio optimization with many risk measures, robust estimators and hierarchical clustering models

BSD-3-Clause licenseOpen sourceFreeLocalSelf-hostable
Visit official site Compare

Link verified Nov 2, 2026

Overview

Riskfolio-Lib is an open-source Python library by Dany Cajas for portfolio construction and risk analysis. It formulates allocation problems with cvxpy and supports a long list of risk measures (variance, MAD, CVaR, EVaR, drawdown-based measures and more), mean-risk, risk-parity, worst-case and robust optimization, Black-Litterman and factor models, and hierarchical approaches such as HRP and HERC. Plotting helpers draw efficient frontiers, risk contributions and drawdown charts, and reports can be exported to Excel. It is aimed at practitioners and researchers who need more risk measures than a basic mean-variance toolkit offers. The breadth comes with a dense API, dependence on commercial or open solvers for some problems, and no backtesting or data layer.

Capabilities

  • Mean-risk optimization across more than a dozen risk measures
  • Risk parity and risk budgeting
  • Hierarchical risk parity and HERC clustering portfolios
  • Black-Litterman and factor-model estimators
  • Worst-case and robust optimization
  • Frontier, risk-contribution and drawdown plots

Typical workflows

  1. Compare CVaR-optimal and variance-optimal frontiers on the same universe
  2. Build a risk-parity allocation and export the report to Excel

Strengths

  • Wide choice of risk measures and models
  • BSD-3-Clause license

Limitations

  • Dense API with many options to configure
  • Some formulations need capable solvers
  • No backtesting or data retrieval

Prerequisites

  • Python with cvxpy, pandas and a supported solver

Who it is for

  • Portfolio managers and risk analysts
  • Finance researchers

Alternatives & comparison

PyPortfolioOpt offers a smaller, more approachable subset of the same ideas; Riskfolio-Lib adds many risk measures, robust models and clustering methods. QuantLib is a pricing library and does not do allocation.

  • Ghostfolio

    Open-source wealth-tracking web app for stocks, ETFs, crypto and other assets, self-hostable with Docker or used as a hosted service

    Open sourceOpen source
  • PyPortfolioOpt

    Python library for portfolio optimization: efficient frontier, Black-Litterman, hierarchical risk parity and discrete allocation

    Open sourceOpen source
  • QuantLib

    Open-source C++ library for quantitative finance covering instruments, term structures, pricing engines and calendars, with Python and other bindings

    Open sourceOpen source
Compare Riskfolio-Lib with its alternatives →

Sources & verification

Primary sources consulted for this record. Claims are tied to the fields each source supports; the automated link checker re-verifies every URL on a schedule.

  • License
    LICENSE.txt (BSD 3-Clause)

    https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt

    Supports: license_spdx

    checked Nov 1, 2026
  • Official site
    Riskfolio-Lib documentation

    https://riskfolio-lib.readthedocs.io/en/latest

    Supports: name, summary, capabilities

    checked Nov 1, 2026
  • Repository
    dcajasn/Riskfolio-Lib

    https://github.com/dcajasn/Riskfolio-Lib

    Supports: product_status, languages

    checked Nov 1, 2026
Confidence
High
Reviewed
Nov 1, 2026
Links
Verified · Nov 2, 2026

Spotted an error?

Broken link, outdated license, wrong category, or a tool that no longer exists? Tell us; reports are reviewed by the editor.

Ghostfolio

Ghostfolio · Portfolio & wealth management

Open-source wealth-tracking web app for stocks, ETFs, crypto and other assets, self-hostable with Docker or used as a hosted service

AGPL-3.0-onlyOpen sourceFreemiumSelf-hostedNov 2, 2026