# ranaroussi/quantstats

Portfolio analytics for quants, written in Python

Repository: https://github.com/ranaroussi/quantstats
Canonical: https://ross.abutalabs.com/products/quantstats
Language: Python
License: Apache-2.0
License Family: permissive
Topics: quant, algotrading, algorithmic-trading, quantitative-trading, quantitative-analysis, algo-trading, python, visualization, plotting, quantitative-finance, finance
Last push: 2026-07-20T14:12:56+00:00

## Health v2 (maintenance only)
Score: 85/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 93, release rhythm 65, longevity 100
- inputs: {"age_days": 2681, "days_push": 44, "days_rel": 232, "gap_med": 2.0, "n_releases_24m": 17}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 7591, forks 1229 (observed 2026-08-28T04:10:01.825458+00:00)

## What it is
QuantStats is a Python library for portfolio analytics that computes performance and risk metrics like Sharpe ratio, volatility, and drawdowns. It includes modules for statistics, plotting, and generating HTML tear-sheet reports, plus Monte Carlo simulation support.

## Use cases
- calculate sharpe ratio and performance metrics for a portfolio
- visualize drawdowns and rolling statistics of returns
- generate an html tear sheet report for a trading strategy
- run monte carlo simulations on returns to estimate bust probability
- extend pandas with financial metrics methods
- profile portfolio risk and volatility

## When to choose
- you need quick quantitative performance and risk metrics on return series in Python
- you want ready-made plots and HTML reports for portfolio performance
- you work in pandas and want financial metrics as dataframe/series methods

## When to avoid
- you need a full backtesting engine or trade execution framework
- you require real-time streaming analytics or broker integration
- you need institutional-grade risk analytics beyond standard metrics

## Facets
- artifact type: library
- maturity: stable
- function: data-visualization, analytics, data-science, charts
- domain: fintech, data-science, data-visualization, analytics
- platform: python, cross-platform
- tags: quantitative-finance, portfolio-analytics, risk-metrics, tear-sheets, sharpe-ratio, monte-carlo-simulation, pandas, algo-trading

## Member repositories
- ranaroussi/quantstats (main) score 85

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:01.825458+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:36:53.309877+00:00, confidence not recorded.
  - readme: https://github.com/ranaroussi/quantstats (fetched 2026-08-28T04:10:01.825458+00:00, sha 1990c688b022)
  - registry_pypi: https://pypi.org/pypi/quantstats/json (fetched 2026-08-29T08:32:11.447623+00:00, sha 48f2ab364dad)
- Data as of 2026-08-30T08:39:29.467469+00:00.
