pyformanceanalytics


Namepyformanceanalytics JSON
Version 0.0.5 PyPI version JSON
download
home_pagehttps://github.com/8W9aG/pyformanceanalytics
SummaryA python wrapper around the PerformanceAnalytics R code.
upload_time2024-04-22 19:31:10
maintainerNone
docs_urlNone
authorWill Sackfield
requires_pythonNone
licenseGPL2
keywords r performanceanalytics
VCS
bugtrack_url
requirements rpy2 pandas pillow numpy
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyformanceanalytics

<a href="https://pypi.org/project/pyformanceanalytics/">
    <img alt="PyPi" src="https://img.shields.io/pypi/v/pyformanceanalytics">
</a>

A python wrapper around the Econometrics [PerformanceAnalytics R package](https://github.com/braverock/PerformanceAnalytics).

## Dependencies :globe_with_meridians:

Python 3.11.6:

- [rpy2 3.5.15](https://rpy2.github.io/)
- [pandas 2.1.4](https://pandas.pydata.org/)
- [Pillow 10.2.0](https://pillow.readthedocs.io/en/stable/reference/Image.html)
- [numpy 1.26.3](https://numpy.org/)

R 4.3.2:

- [PerformanceAnalytics 2.0.4](https://github.com/braverock/PerformanceAnalytics)
- [ggplot2 3.4.4](https://ggplot2.tidyverse.org/)
- [gridExtra 2.3](https://cran.r-project.org/web/packages/gridExtra/index.html)
- [quantreg 5.97](https://www.rdocumentation.org/packages/quantreg/versions/5.97)
- [RobStatTM 1.0.8](https://github.com/msalibian/RobStatTM)

## 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:

```python
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](pyformanceanalytics/README.md). This library ports over 100 functions, 20 charts and 20 tables.

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

```python
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](pyformanceanalytics/charts/PerformanceSummary.jpg "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](LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/8W9aG/pyformanceanalytics",
    "name": "pyformanceanalytics",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "r performanceanalytics",
    "author": "Will Sackfield",
    "author_email": "will.sackfield@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/7c/c2/91b9755aa2986c8841b444a758fb410dc7cb91db0dbb8094a5d8ca33bea6/pyformanceanalytics-0.0.5.tar.gz",
    "platform": null,
    "description": "# pyformanceanalytics\n\n<a href=\"https://pypi.org/project/pyformanceanalytics/\">\n    <img alt=\"PyPi\" src=\"https://img.shields.io/pypi/v/pyformanceanalytics\">\n</a>\n\nA python wrapper around the Econometrics [PerformanceAnalytics R package](https://github.com/braverock/PerformanceAnalytics).\n\n## Dependencies :globe_with_meridians:\n\nPython 3.11.6:\n\n- [rpy2 3.5.15](https://rpy2.github.io/)\n- [pandas 2.1.4](https://pandas.pydata.org/)\n- [Pillow 10.2.0](https://pillow.readthedocs.io/en/stable/reference/Image.html)\n- [numpy 1.26.3](https://numpy.org/)\n\nR 4.3.2:\n\n- [PerformanceAnalytics 2.0.4](https://github.com/braverock/PerformanceAnalytics)\n- [ggplot2 3.4.4](https://ggplot2.tidyverse.org/)\n- [gridExtra 2.3](https://cran.r-project.org/web/packages/gridExtra/index.html)\n- [quantreg 5.97](https://www.rdocumentation.org/packages/quantreg/versions/5.97)\n- [RobStatTM 1.0.8](https://github.com/msalibian/RobStatTM)\n\n## Raison D'\u00eatre :thought_balloon:\n\nPerformanceAnalytics is an outstanding Econometrics library written in R that has been battle tested by many quantitative finance firms.\nWe 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.\nThe library very closely follows the conventions laid out in PerformanceAnalytics, for example to determine information ratio you can simply use the following code:\n\n```python\nfrom pyformanceanalytics import InformationRatio\n\ninf_rat_flt = InformationRatio(df)\n```\n\nThe functions and modules are designed to be as close to the PerformanceAnalytics package as possible for easy porting.\n\n\n## Installation :inbox_tray:\n\nThis is a python package hosted on pypi, so to install simply run the following command:\n\n`pip install pyformanceanalytics`\n\nNote that upon running this package for the first time, you may notice a slight delay as it downloads the relevant R packages.\n\n## Usage example :eyes:\n\nTo get familiar with the individual functions and charts check out the documents in the [pyformanceanalytics README](pyformanceanalytics/README.md). This library ports over 100 functions, 20 charts and 20 tables.\n\nThis supports both tables, functions and charts. An example of generating a chart:\n\n```python\nimport pandas as pd\nfrom pyformanceanalytics.charts import PerformanceSummary\n\ndf = pd.read_csv(\"pyformanceanalytics/managers.csv\", index_col=0)\ndf.index = pd.to_datetime(df.index)\nPerformanceSummary(df).show()\n```\n\n![PerformanceSummary](pyformanceanalytics/charts/PerformanceSummary.jpg \"PerformanceSummary\")\n\nThis outputs a `PIL` image, which automatically shows on colab instances.\n\nYou can feed in multiple portfolios to get your results in a `DataFrame`, else they may be reported as single floats.\n\n## License :memo:\n\nThe project is available under the [GPL2 License](LICENSE).\n",
    "bugtrack_url": null,
    "license": "GPL2",
    "summary": "A python wrapper around the PerformanceAnalytics R code.",
    "version": "0.0.5",
    "project_urls": {
        "Homepage": "https://github.com/8W9aG/pyformanceanalytics"
    },
    "split_keywords": [
        "r",
        "performanceanalytics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7cc291b9755aa2986c8841b444a758fb410dc7cb91db0dbb8094a5d8ca33bea6",
                "md5": "0dad8a23aa06509f75ed86fb7ed5fb81",
                "sha256": "36d7703ed25116d21dc8ef945deab7dc692e816c832ed50ed481c915cd1ffdf8"
            },
            "downloads": -1,
            "filename": "pyformanceanalytics-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "0dad8a23aa06509f75ed86fb7ed5fb81",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 91236,
            "upload_time": "2024-04-22T19:31:10",
            "upload_time_iso_8601": "2024-04-22T19:31:10.676428Z",
            "url": "https://files.pythonhosted.org/packages/7c/c2/91b9755aa2986c8841b444a758fb410dc7cb91db0dbb8094a5d8ca33bea6/pyformanceanalytics-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-22 19:31:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "8W9aG",
    "github_project": "pyformanceanalytics",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "rpy2",
            "specs": [
                [
                    ">=",
                    "3.5.15"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    ">=",
                    "2.1.4"
                ]
            ]
        },
        {
            "name": "pillow",
            "specs": [
                [
                    ">=",
                    "10.2.0"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    ">=",
                    "1.26.3"
                ]
            ]
        }
    ],
    "lcname": "pyformanceanalytics"
}
        
Elapsed time: 0.23705s