# quantopian/empyrical

Common financial risk and performance metrics. Used by zipline and pyfolio.

Repository: https://github.com/quantopian/empyrical
Canonical: https://ross.abutalabs.com/products/empyrical
Homepage: https://quantopian.github.io/empyrical
Language: Python
License: Apache-2.0
License Family: permissive
Last push: 2024-07-26T06:19:42+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3820, "days_push": 768, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1508, forks 459 (observed 2026-08-28T04:04:55.609933+00:00)

## What it is
A Python library of common financial risk and performance metrics such as max drawdown, alpha, beta, and capture ratios, built on NumPy and pandas. It is used by Quantopian's zipline backtesting framework and pyfolio portfolio analysis tool.

## Use cases
- calculate max drawdown of a returns series
- compute alpha and beta against a benchmark
- compute rolling risk metrics like rolling sharpe or rolling max drawdown
- calculate capture ratios for up and down markets
- evaluate backtest performance statistics in zipline or pyfolio

## When to choose
- you need standard quantitative finance risk/performance statistics in Python
- you are using zipline or pyfolio and need compatible metrics
- you work with pandas Series or NumPy arrays of returns

## When to avoid
- you need built-in market data fetching - data reading via pandas-datareader is deprecated and unreliable
- you need actively developed features - the library is in maintenance mode
- you need a full backtesting or portfolio analytics platform rather than just metrics

## Facets
- artifact type: library
- maturity: maintenance
- function: math, data-science
- domain: fintech, data-science, analytics
- platform: python
- tags: quantitative-finance, risk-metrics, performance-metrics, pandas, numpy, quantopian

## Member repositories
- quantopian/empyrical (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:55.609933+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-30T04:32:34.245666+00:00, confidence not recorded.
  - readme: https://github.com/quantopian/empyrical (fetched 2026-08-28T04:04:55.609933+00:00, sha 2f9d8dc2adf0)
  - homepage: https://quantopian.github.io/empyrical (fetched 2026-08-29T11:36:57.636480+00:00, sha 4f4cecfc3257)
  - registry_pypi: https://pypi.org/pypi/empyrical/json (fetched 2026-08-29T11:36:57.645341+00:00, sha 0ed2aa708ef3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
