Skip to main content

A python wrapper around the PerformanceAnalytics R code.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyformanceanalytics-0.0.5.tar.gz (91.2 kB view details)

Uploaded Source

File details

Details for the file pyformanceanalytics-0.0.5.tar.gz.

File metadata

  • Download URL: pyformanceanalytics-0.0.5.tar.gz
  • Upload date:
  • Size: 91.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pyformanceanalytics-0.0.5.tar.gz
Algorithm Hash digest
SHA256 36d7703ed25116d21dc8ef945deab7dc692e816c832ed50ed481c915cd1ffdf8
MD5 0dad8a23aa06509f75ed86fb7ed5fb81
BLAKE2b-256 7cc291b9755aa2986c8841b444a758fb410dc7cb91db0dbb8094a5d8ca33bea6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page