Skip to main content

pyformanceanalytics

PyPi

A python wrapper around the Econometrics PerformanceAnalytics R package.

Dependencies :globe_with_meridians:

Python 3.11.6:

R 4.3.2:

Raison D'être :thought_balloon:

PerformanceAnalytics is an outstanding Econometrics library written in R that has been battle tested by many quantitative finance firms. We have a need to use this alongside some machine learning we are doing in python, so to bridge the gap we created this wrapper library. The library very closely follows the conventions laid out in PerformanceAnalytics, for example to determine information ratio you can simply use the following code:

from pyformanceanalytics import InformationRatio

inf_rat_flt = InformationRatio(df)

The functions and modules are designed to be as close to the PerformanceAnalytics package as possible for easy porting.

Installation :inbox_tray:

This is a python package hosted on pypi, so to install simply run the following command:

pip install pyformanceanalytics

Note that upon running this package for the first time, you may notice a slight delay as it downloads the relevant R packages.

Usage example :eyes:

To get familiar with the individual functions and charts check out the documents in the pyformanceanalytics README. This library ports over 100 functions, 20 charts and 20 tables.

This supports both tables, functions and charts. An example of generating a chart:

import pandas as pd
from pyformanceanalytics.charts import PerformanceSummary

df = pd.read_csv("pyformanceanalytics/managers.csv", index_col=0)
df.index = pd.to_datetime(df.index)
PerformanceSummary(df).show()

PerformanceSummary

This outputs a PIL image, which automatically shows on colab instances.

You can feed in multiple portfolios to get your results in a DataFrame, else they may be reported as single floats.

License :memo:

The project is available under the GPL2 License.

Metadata

Release files for pyformanceanalytics 0.0.5

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

Source distribution (sdist)

Source distribution for pyformanceanalytics 0.0.5
File Size Uploaded Provenance
pyformanceanalytics-0.0.5.tar.gz 91.2 kB Without provenance Details

Release files / pyformanceanalytics-0.0.5.tar.gz

Download URL pyformanceanalytics-0.0.5.tar.gz
Size 91.2 kB
Tags Source
SHA-256 checksum
How to use checksums
36d7703ed25116d21dc8ef945deab7dc692e816c832ed50ed481c915cd1ffdf8
BLAKE2b-256 checksum
How to use checksums
7cc291b9755aa2986c8841b444a758fb410dc7cb91db0dbb8094a5d8ca33bea6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Security for pyformanceanalytics 0.0.5

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.

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