Skip to main content

PyPI Tests conda PyPI Coverage Status GitHub issues Discourse users 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.

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

To install pyfolio, run:

pip install pyfolio-reloaded

or

conda install -c ml4t pyfolio-reloaded

Development

For development, you may want to use a virtual environment to avoid dependency conflicts between pyfolio and other Python projects you have.

To get set up with a virtual env, run:

mkvirtualenv pyfolio

Next, clone this git repository and run python -m pip install .[all] and edit the library files directly.

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

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-tej 2.0.4

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-tej 2.0.4
File Size Uploaded Provenance Actions
pyfolio_tej-2.0.4.tar.gz 88.4 kB Without provenance Details for pyfolio_tej-2.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyfolio-tej 2.0.4
File Interpreter ABI Platform Actions
pyfolio_tej-2.0.4-py3-none-any.whl Python 3 none any Details for pyfolio_tej-2.0.4-py3-none-any.whl

Total release size: 162.8 kB

Release files / pyfolio_tej-2.0.4.tar.gz

Download URL pyfolio_tej-2.0.4.tar.gz
Size 88.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2e836b5d956e97045c56ecf15bff1bf22be1d2652cb79d9a7576d11b444605d5
BLAKE2b-256 checksum
How to use checksums
043ac97430d8c6b033a1046d8603671c9b7b151f38d48e30e79b995643cd383f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release files / pyfolio_tej-2.0.4-py3-none-any.whl

Download URL pyfolio_tej-2.0.4-py3-none-any.whl
Size 74.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ee7b8f4514d557c84b8ac880c61c3bd1182c46c61fb259e56ca9ead38110b9f
BLAKE2b-256 checksum
How to use checksums
18c852c30f7a5142c5126cd0db8dc75e1d9968123ce4c14af2c39835ed7b559e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Security for pyfolio-tej 2.0.4

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