{"id":27718,"library":"empyrical-reloaded","title":"empyrical-reloaded","description":"empyrical-reloaded is a fork of the original empyrical library that computes performance and risk statistics commonly used in quantitative finance, such as Sharpe ratio, Sortino ratio, max drawdown, and others. Current version 0.5.12 targets Python >=3.9 and is under active maintenance with occasional releases.","status":"active","version":"0.5.12","language":"python","source_language":"en","source_url":"https://github.com/ranaroussi/empyrical-reloaded","tags":["finance","risk-metrics","performance-analysis","quantitative-finance","empyrical-fork"],"install":[{"cmd":"pip install empyrical-reloaded","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"core dependency for numerical operations","package":"numpy","optional":false},{"reason":"required for input data (Series/DataFrame) and output formatting","package":"pandas","optional":false},{"reason":"used for statistical functions (e.g., beta, skew, kurtosis)","package":"scipy","optional":false}],"imports":[{"note":"The main module is just 'empyrical'. No subpackage needed.","wrong":"import empyrical as emp (works but often causes confusion for submodule access)","symbol":"empyrical","correct":"import empyrical"},{"note":"Original empyrical had submodules; this fork keeps everything at top level.","wrong":"from empyrical.stats import sharpe_ratio","symbol":"sharpe_ratio","correct":"from empyrical import sharpe_ratio"}],"quickstart":{"code":"import pandas as pd\nimport empyrical\n\n# Example returns series\nreturns = pd.Series([0.01, -0.02, 0.03, 0.02, -0.01], name='Returns')\n\n# Compute Sharpe ratio (assumes risk-free rate = 0)\nsharpe = empyrical.sharpe_ratio(returns, period='daily', annualization=252)\nprint(f\"Sharpe ratio: {sharpe:.4f}\")\n\n# Compute max drawdown\nmax_dd = empyrical.max_drawdown(returns)\nprint(f\"Max drawdown: {max_dd:.4%}\")","lang":"python","description":"Computes common risk/performance metrics from a returns series."},"warnings":[{"fix":"Uninstall empyrical and install empyrical-reloaded: pip uninstall empyrical; pip install empyrical-reloaded","message":"The original 'empyrical' package was taken over by a malicious actor. 'empyrical-reloaded' is the maintained fork. Do not install 'empyrical' (0.5.10 or earlier) as it may be compromised.","severity":"breaking","affected_versions":"<0.5.11 of empyrical"},{"fix":"Ensure returns are sorted by date ascending before passing to empyrical functions","message":"Many functions require returns sorted in ascending order (oldest first). Passing a series in reverse order will produce incorrect results without warning.","severity":"gotcha","affected_versions":"all"},{"fix":"Always provide 'period' and 'annualization' for metrics that depend on frequency (Sharpe, Sortino, Calmar, etc.).","message":"'period' keyword is sometimes required, sometimes ignored. For example, 'sharpe_ratio' needs a 'period' to determine annualization, while 'max_drawdown' does not. Check docstrings.","severity":"gotcha","affected_versions":"all"},{"fix":"Always pass annualization=252 for daily data, 52 for weekly, 12 for monthly.","message":"The 'annualization' parameter default is set to None, which may raise a TypeError in future versions. You must explicitly provide it.","severity":"deprecated","affected_versions":">=0.5.11 <=0.5.12"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run: pip install empyrical-reloaded","cause":"You installed the original 'empyrical' (compromised) or 'empyrical-reloaded' is not installed.","error":"ModuleNotFoundError: No module named 'empyrical'"},{"fix":"Use: sharpe_ratio = empyrical.sharpe_ratio(returns, period='daily', annualization=252)","cause":"Called sharpe_ratio without parentheses or with wrong arguments.","error":"TypeError: sharpe_ratio() missing 1 required positional argument: 'returns'"},{"fix":"Convert to pandas Series: returns = pd.Series(returns_list)","cause":"Passed a list or numpy array instead of a pandas object.","error":"ValueError: Input must be a pandas Series or DataFrame"},{"fix":"Import directly: from empyrical import sharpe_ratio","cause":"Trying to import from a different module structure (e.g., from empyrical.stats).","error":"ImportError: cannot import name 'sharpe_ratio' from 'empyrical'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}