A weeknight listicle: Riskfolio-Lib 7.3.0 (31 May 2026, Entropy Pooling + MVSK), PyPortfolioOpt risk_models, arch GARCH, cvxpy, and statsmodels/scipy. pip plus a CVaR / HRP / vol sketch. Not FinRL, not vectorbt/Nautilus/Lean, not a ranking contest. Not investment advice.
Five libraries you can pip on a weeknight if you want risk measures, covariance, GARCH, and a convex optimiser — not a live trading stack. This is not a search-volume ranking, not FinRL, not vectorbt / Nautilus / Lean, and not investment advice. The only course CTA is Introduction to Python Programming.
Related Hub: SciPy 1.18 Whittaker–Henderson, statsmodels 0.15.
PyPI riskfolio-lib 7.3.0 and dcajasn/Riskfolio-Lib (Dany Cajas). 7.3.0 landed 31 May 2026. The changelog adds:
Portfolio and HCPortfolio.The README still lists Mean-Risk with many convex measures including CVaR, plus HRP / HERC hierarchical portfolios, all on CVXPY. Python ≥ 3.10. Optional example extras in that README include yfinance and vectorbt — this listicle does not cover vectorbt.
pip install "riskfolio-lib==7.3.0"
risk_modelsRisk Models docs: sample covariance, semicovariance, exponential covariance, Ledoit–Wolf / OAS shrinkage, fix_nonpositive_semidefinite. The docs explicitly say sample covariance should not be the default — use shrinkage. Good when you already have a price/returns frame and want a PSD annualised covariance before any optimiser.
pip install PyPortfolioOpt
Kevin Sheppard’s arch is the usual Python home for univariate GARCH, EGARCH, etc. Riskfolio-Lib 7.3.0 even lists arch>=7.2 as a dependency. Use it for conditional volatility on one return series, not for a 50-name HRP book.
pip install arch
CVXPY is how Riskfolio (and a lot of mean-CVaR notebooks) talk to Clarabel / SCS / optional MOSEK. If you only need “minimise CVaR subject to weights summing to one” on a toy matrix, you can skip Riskfolio and write the LP yourself. If you want 20 risk measures and HRP plots, don’t.
pip install cvxpy
Not portfolio packages. They are the vol and cycle toolkit you already have: GARCH-adjacent tests and filters in statsmodels, scipy.signal (including 1.18 whittaker_henderson / HP-like order 2). Pair them with arch rather than replacing it.
pip install statsmodels scipy
Do not paste this onto live broker data tonight. Synthetic multivariate normal returns; check versions; stop.
import numpy as np
import pandas as pd
rng = np.random.default_rng(7)
n, k = 252, 4
R = pd.DataFrame(rng.normal(0.0004, 0.012, size=(n, k)), columns=list("ABCD"))
from arch import arch_model
am = arch_model(R["A"] * 100, vol="Garch", p=1, q=1, dist="normal")
res = am.fit(disp="off")
print("arch", res.conditional_volatility.tail(3))
from pypfopt import risk_models
S = risk_models.risk_matrix(R, returns_data=True, method="ledoit_wolf")
print("ledoit_wolf shape", S.shape)
import riskfolio as rp
port = rp.Portfolio(returns=R)
port.assets_stats(method_mu="hist", method_cov="hist")
w_hrp = rp.HCPortfolio(returns=R).optimization(model="HRP", codependence="pearson", rm="MV", rf=0, linkage="single", leaf_order=True)
print("HRP weights\n", w_hrp)
port.lowerret = None
w_cvar = port.optimization(model="Classic", rm="CVaR", obj="MinRisk", rf=0, l=0, hist=True)
print("min CVaR weights\n", w_cvar)
If HCPortfolio.optimization kwargs differ in 7.3.0, read the docstring. If CVXPY complains about the solver, install clarabel before a commercial licence.
If Python packaging is the blocker, Introduction to Python Programming, then pip install one of the five and print its version.