stefan-jansen/empyrical-reloaded — an open-source project — sits at 134 GitHub stars. Common financial risk and performance metrics. Used by zipline and pyfolio.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Common financial return and risk metrics in Python.
Maintenance and new projects
We continue to maintain Empyrical Reloaded for bug, security, and compatibility fixes.
Our new feature development focuses on ML4T Diagnostic,
part of the ML4T libraries.
For new projects, start with Diagnostic's maintained
Empyrical migration guide
and published documentation.
Check each recipe's package and release requirements before using APIs documented in source.
Keep annualization, periodic versus annual rates, missing-value policies and return/loss signs
explicit; similarly named metrics need not have equivalent behavior.
The historical ten-metric comparison,
frozen source migration recipe
and frozen capability reference
retain earlier tested versions and findings. They do not describe current successor coverage
or establish complete replacement of Empyrical.
Installation
Empyrical Reloaded supports Python 3.11 through 3.15. Python 3.9 and 3.10 are retired
for this release; historical packages retain their original Python requirements.
You can install it using pip:
pip install empyrical-reloaded
or conda from the conda-forge channel
conda install empyrical-reloaded -c conda-forge
The installer provides NumPy, pandas, SciPy and the other declared runtime dependencies.
Note that Numpy>=2.0 requires pandas>=2.2.2. If you are using an older version of pandas, you may need to upgrade
accordingly, otherwise you may encounter compatibility issues.
Optional dependencies include yfinance to download price data
from Yahoo! Finance
and pandas-datareader to
access Fama-French risk factors and FRED
treasury yields.
Empyrical computes basic metrics from returns and volatility to alpha and beta, Value at Risk, and Sharpe or Sortino
ratios.
import numpy as np
from empyrical import max_drawdown, alpha_beta
returns = np.array([.01, .02, .03, -.4, -.06, -.02])
benchmark_returns = np.array([.02, .02, .03, -.35, -.05, -.01])
# calculate the max drawdown
max_drawdown(returns)
# calculate alpha and beta
alpha, beta = alpha_beta(returns, benchmark_returns)
Rolling Measures
Empyrical also aggregates return and risk metrics for rolling windows:
import numpy as np
from empyrical import roll_max_drawdown
returns = np.array([.01, .02, .03, -.4, -.06, -.02])
# calculate the rolling max drawdown
roll_max_drawdown(returns, window=3)
Pandas Support
Empyrical also works with both NumPy arrays and Pandas data
structures:
import pandas as pd
from empyrical import roll_up_capture, capture
returns = pd.Series([.01, .02, .03, -.4, -.06, -.02])
factor_returns = pd.Series([.02, .01, .03, -.01, -.02, .02])
# calculate a capture ratio
capture(returns, factor_returns)
-0.147387712263491
Fama-French Risk Factors
Empyrical downloads Fama-French risk factors from 1970 onward:
Requires optional dependency pandas-datareader - see installation instructions above.
Empyrical use yfinance to download price data
from Yahoo! Finance. To obtain the S&P returns since 1950, use:
Note: requires optional dependency yfinance - see installation instructions above.
import empyrical as emp
symbol = '^GSPC'
returns = emp.utils.get_symbol_returns_from_yahoo(symbol,
start='1950-01-01')
import seaborn as sns # requires separate installation
import matplotlib.pyplot as plt # requires separate installation
fig, axes = plt.subplots(ncols=2, figsize=(14, 5))
with sns.axes_style('whitegrid'):
returns.plot(ax=axes[0], rot=0, title='Time Series', legend=False)
sns.histplot(returns, ax=axes[1], legend=False)
axes[1].set_title('Histogram')
sns.despine()
plt.tight_layout()
plt.suptitle('Daily S&P 500 Returns')
Documentation
See the documentation for details on the API.
Support
Please open an issue for support.
Contributing
Empyrical Reloaded accepts bug, security, and compatibility fixes. Read the
contribution guide
for issue scope, regression evidence, review checks, and AI disclosure requirements.
Does stefan-jansen/empyrical-reloaded have any tags?
TopGit's last sync did not record any GitHub topics for stefan-jansen/empyrical-reloaded. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on stefan-jansen/empyrical-reloaded?
The most recent commit recorded on stefan-jansen/empyrical-reloaded was 6 days ago, based on the GitHub push timestamp. The repository has 53 forks — one of the better signals of community interest.
Is stefan-jansen/empyrical-reloaded open source?
Yes — stefan-jansen/empyrical-reloaded ships under the Apache-2.0 license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/stefan-jansen/empyrical-reloaded.
What license does stefan-jansen/empyrical-reloaded use?
stefan-jansen/empyrical-reloaded is released under the Apache-2.0 license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where can I see stefan-jansen/empyrical-reloaded in action?
The project maintains a homepage at https://empyrical.ml4trading.io/. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about stefan-jansen/empyrical-reloaded?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/stefan-jansen/empyrical-reloaded is the definitive source.
Read full README in the tab above.
Is empyrical-reloaded worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of empyrical-reloaded.