Metadata-Version: 2.4
Name: pyfolio-reloaded
Version: 0.10.0
Summary: Performance and risk analysis of financial portfolios with Python
Author: Quantopian Inc
Author-email: pm@ml4trading.io
Maintainer: Stefan Jansen
Maintainer-email: pm@ml4trading.io
License-Expression: Apache-2.0
Project-URL: homepage, https://ml4trading.io
Project-URL: repository, https://github.com/stefan-jansen/pyfolio-reloaded
Project-URL: documentation, https://pyfolio.ml4trading.io
Classifier: Development Status :: 4 - Beta
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: <3.16,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy<3,>=1.23.5; python_version < "3.12"
Requires-Dist: numpy<3,>=1.26.0; python_version >= "3.12" and python_version < "3.14"
Requires-Dist: numpy<3,>=2.3.3; python_version >= "3.14" and python_version < "3.15"
Requires-Dist: numpy<3,>=2.5.4; python_version >= "3.15"
Requires-Dist: pandas<3,>=1.5.0; python_version < "3.14"
Requires-Dist: pandas<3,>=2.3.3; python_version >= "3.14" and python_version < "3.15"
Requires-Dist: pandas<3.1,>=3.0.6; python_version >= "3.15"
Requires-Dist: ipython>=3.2.3
Requires-Dist: matplotlib>=1.4.0
Requires-Dist: pytz>=2014.10
Requires-Dist: scipy>=0.14.0
Requires-Dist: scikit-learn>=0.16.1
Requires-Dist: seaborn>=0.7.1
Requires-Dist: empyrical-reloaded>=0.5.11
Provides-Extra: test
Requires-Dist: tox>=2.3.1; extra == "test"
Requires-Dist: coverage>=7.16.2; extra == "test"
Requires-Dist: coveralls>=4.1.0; extra == "test"
Requires-Dist: pytest>=6.2; extra == "test"
Requires-Dist: pytest-xdist>=2.5.0; extra == "test"
Requires-Dist: pytest-cov>=2.12; extra == "test"
Requires-Dist: parameterized>=0.6.1; extra == "test"
Requires-Dist: pytest-rerunfailures; extra == "test"
Requires-Dist: flake8>=3.9.1; extra == "test"
Requires-Dist: black; extra == "test"
Provides-Extra: dev
Requires-Dist: flake8>=3.9.1; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: pre-commit>=2.12.1; extra == "dev"
Provides-Extra: docs
Requires-Dist: Cython; extra == "docs"
Requires-Dist: Sphinx>=1.3.2; extra == "docs"
Requires-Dist: numpydoc>=0.5.0; extra == "docs"
Requires-Dist: nbsphinx; extra == "docs"
Requires-Dist: sphinx-autobuild>=0.6.0; extra == "docs"
Requires-Dist: pydata-sphinx-theme; extra == "docs"
Requires-Dist: sphinx-markdown-tables; extra == "docs"
Requires-Dist: sphinx_copybutton; extra == "docs"
Requires-Dist: m2r2; extra == "docs"
Dynamic: license-file

<p align="center">
<a href="https://pyfolio.ml4trading.io">
<img src="https://i.imgur.com/GD6TZ0D.png" width="35%">
</a>
</p>

![PyPI](https://img.shields.io/pypi/v/pyfolio-reloaded)
[![Tests](https://github.com/stefan-jansen/pyfolio-reloaded/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/stefan-jansen/pyfolio-reloaded/actions/workflows/unit_tests.yml)
[![PyPI](https://github.com/stefan-jansen/pyfolio-reloaded/actions/workflows/build_wheels.yml/badge.svg)](https://github.com/stefan-jansen/pyfolio-reloaded/actions/workflows/build_wheels.yml)
[![Coverage Status](https://coveralls.io/repos/github/stefan-jansen/pyfolio-reloaded/badge.svg?branch=main)](https://coveralls.io/github/stefan-jansen/pyfolio-reloaded?branch=main)
![GitHub issues](https://img.shields.io/github/issues/stefan-jansen/pyfolio-reloaded)
![Twitter Follow](https://img.shields.io/twitter/follow/ml4trading?style=social)

pyfolio is a Python library for performance and risk analysis of financial portfolios that works well with the [Zipline](https://zipline.ml4trading.io/) open source backtesting library.

## Maintenance and new development

We continue to maintain Pyfolio Reloaded for bug, security and compatibility fixes.
Our new feature development focuses on the current [ML4T libraries](https://www.ml4trading.io/),
including [ML4T Diagnostic](https://github.com/ml4t/diagnostic).
For new projects, we recommend evaluating Diagnostic through its
[migration guide](https://www.ml4trading.io/docs/diagnostic/user-guide/migration/#pyfolio-portfolio-and-performance-analysis),
which includes a runnable portfolio example and explains differences between the workflows.
See the [Diagnostic documentation](https://www.ml4trading.io/docs/diagnostic/) for its supported APIs.

## Trading Strategy Analysis with pyfolio

At the core of pyfolio are various tear sheets that combine various individual plots and summary statistics to
provide a comprehensive view of the performance of a trading algorithm.

Here's an example of a simple tear sheet analyzing a strategy executed with the Zipline backtesting engine:

### Performance Metrics

The tear sheet presents performance and risk metrics for the strategy separately during the backtest and out-of-sample periods:

<p align="center">
<a href="#">
<img src="https://i.imgur.com/bfwMeIV.png" width="50%">
</a>
</p>

### Performance Plots

In addition, it visualizes how several risk and return metrics behave over time:

<p align="center">
<a href="#">
<img src="https://i.imgur.com/5Hyuet3.png" width="85%">
</a>
</p>

## Installation

This source version targets Python 3.11-3.15. Python 3.9 and 3.10 are end of life
and are retired from the next release. Existing release artifacts retain their
original Python requirements. See the [Python support schedule](https://devguide.python.org/versions/).

Python 3.14 requires pandas 2.3.3 and NumPy 2.3.3 or newer. Python 3.15 requires
pandas 3.0.6 and NumPy 2.5.4 or newer; pandas 2.3.3 crashes during date-range
construction in the stable CPython 3.15 Linux qualification. The dependency markers
select the appropriate combination. Bottleneck currently builds from source on
Python 3.15, so that installation needs a C compiler.

To install a published Pyfolio release into a supported environment, run:

```bash
pip install pyfolio-reloaded
```

The Conda channel contains historical releases:

```bash
conda install -c ml4t pyfolio-reloaded
```

The frozen Conda 0.9.4 recipe and existing channel artifacts are preserved.
That recipe does not build this source version, and its publishing workflow is retired.

### Development

Clone this repository, then create an isolated environment and install the declared extras:

```bash
uv venv --python 3.11
uv pip install -e '.[test,docs,dev]'
uv run pre-commit install
```

## Usage

A good way to get started is to run the pyfolio examples in a
[Jupyter notebook](https://jupyter.org/). To do this, you first want to
start a Jupyter notebook server:

```bash
jupyter notebook
```

From the notebook list page, navigate to the pyfolio examples directory
and open a notebook. Execute the code in a notebook cell by clicking on it
and hitting Shift+Enter.


## Questions?

If you find a bug, feel free to [open an issue](https://github.com/stefan-jansen/pyfolio-reloaded/issues) in this repository.

You can also join our [community](https://exchange.ml4trading.io).

## Support

Please [open an issue](https://github.com/stefan-jansen/pyfolio-reloaded/issues/new) for support.

## Contributing

Read the [contribution guide](https://github.com/stefan-jansen/pyfolio-reloaded/blob/main/CONTRIBUTING.md)
before submitting an issue or pull request. This library accepts bug, security and compatibility fixes.

If you'd like to contribute, a great place to look is the [issues marked with help-wanted](https://github.com/stefan-jansen/pyfolio-reloaded/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).

For a list of core developers and outside collaborators, see [the GitHub contributors list](https://github.com/stefan-jansen/pyfolio-reloaded/graphs/contributors).
