lib-riskfoliolisted
Install: claude install-skill howard-lynn-ye/fin-skills
# Riskfolio-Lib
The most feature-complete open-source portfolio optimizer in Python. Its moat is **26 convex risk measures**, so you
can run HRP, HERC, NCO or risk parity under CVaR, CDaR, EVaR or Ulcer instead of variance.
| | |
|---|---|
| pip / import | `Riskfolio-Lib` / **`riskfolio`** (conventionally `import riskfolio as rp`) |
| Version | **7.3.0** (2026-05-31) · Python `>=3.10` |
| Licence | **BSD-3-Clause** |
| Status | ✅ **actively developed and unusually well-tended** — `dcajasn/Riskfolio-Lib`, 4,480★ / **18 open issues** (an outlier in this ecosystem), pushed 2026-08-18 |
## The trap that costs you money
🚨 **The API is imperative and stateful, not sklearn-like.** You must call `port.assets_stats(...)` **before**
`port.optimization(...)`, and **re-call it after changing the data**. Skipping it, or mutating `port.returns`
afterwards, optimizes against stale or missing μ and Σ rather than raising. The weights come back looking normal.
It also does **not** compose with `sklearn.Pipeline` or `GridSearchCV`. If you need cross-validated hyperparameter
search over portfolio models, that is `lib-skfolio`.
## Returns, not prices
🚨 `rp.Portfolio(returns=...)` and `rp.HCPortfolio(returns=...)` take **RETURNS**. A price DataFrame runs silently and
yields a garbage covariance and garbage weights — the same failure mode as PyPortfolioOpt's `HRPOpt`. Check for
negative values before you pass.
⚠️ **pip name ≠ import name:** `pip install Riskfolio-Lib`, then `import riskfo