Skip to main content

PyPI Tests PyPI Coverage Status GitHub issues Twitter Follow

pyfolio is a Python library for performance and risk analysis of financial portfolios that works well with the Zipline 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, including ML4T Diagnostic. For new projects, we recommend evaluating Diagnostic through its migration guide, which includes a runnable portfolio example and explains differences between the workflows. See the Diagnostic documentation 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:

Performance Plots

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

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.

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:

pip install pyfolio-reloaded

The Conda channel contains historical releases:

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:

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. To do this, you first want to start a Jupyter notebook server:

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 in this repository.

You can also join our community.

Support

Please open an issue for support.

Contributing

Read the contribution guide 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.

For a list of core developers and outside collaborators, see the GitHub contributors list.

Metadata

Release files for pyfolio-reloaded 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyfolio-reloaded 0.10.0
File Size Uploaded Provenance
pyfolio_reloaded-0.10.0.tar.gz 13.2 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyfolio-reloaded 0.10.0
File Interpreter ABI Platform
pyfolio_reloaded-0.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.4 MB

Release files / pyfolio_reloaded-0.10.0.tar.gz

Download URL pyfolio_reloaded-0.10.0.tar.gz
Size 13.2 MB
Tags Source
SHA-256 checksum
How to use checksums
b05023322f329d071b7b86865b16fd7a9242e21105a6e0c365d90412e2dfac53
BLAKE2b-256 checksum
How to use checksums
00a33c95a6896210b805c4f473759cde0c738dd8a1e81a2e6314398e7e7895db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pyfolio_reloaded-0.10.0-py3-none-any.whl

Download URL pyfolio_reloaded-0.10.0-py3-none-any.whl
Size 6.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
19f52c9b3c3f0686aabf34fb2029f4fb5060bb5734d5bd411926042eb80ee904
BLAKE2b-256 checksum
How to use checksums
e17a8d1a499ecb184dd781d65f6b80204fbfde5d639b42fb237e39829f73515d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for pyfolio-reloaded 0.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page