Skip to main content

performance-analysis

Features

  • Performance indicators calculation

  • Supports single time series data and multiple time series data with different time spans

  • Time series visualization

Installation

You can install “performance-analysis” via ‘pip’_ from ‘PyPI’_:

$ pip install performance-analysis

Usage

  • Performance part

from performance_analysis.Performance import Performance
# Input return data
raw_return_data = pd.read_csv("./raw_return_data.csv")
# Just some examples. For more functions, you can explore the package
ann_rtn = Performance.annualized_return(raw_return_data, period = Constant.DAILY, logreturn = False)
var = Performance.value_at_risk(raw_return_data, significance_level = 0.05)
sharpe = Performance.sharpe_ratio(raw_return_data, risk_free = 0., logreturn = False)
calmar = Performance.calmar_ratio(raw_return_data, period = Constant.DAILY, logreturn = False)
  • Computes personal specified indicators

'''
indicators = {
        0 : annualized_return,
        1 : annualized_sd,
        2 : max_drawdown,
        3 : sharpe_ratio,
        4 : calmar_ratio,
        5 : burke_ratio,
        6 : downside_risk,
        7 : sortino_ratio,
        8 : tracking_error,
        9 : information_ratio,
        10 : capm_beta,
        11 : capm_alpha,
        12 : treynor_ratio,
        13 : skewness,
        14 : kurtosis,
        15 : value_at_risk,
        16 : conditional_value_at_risk,
        17 : omega_ratio,
        18 : tail_dependence,
        19 : TDC,
    }
'''

args = (0,1,2,3,4)
kwargs = {
    "annualized_return" : {"returns" : single_return_data},
    "annualized_sd" : {"returns" : single_return_data},
    "max_drawdown" : {"returns" : single_return_data},
    "sharpe_ratio" : {"returns" : single_return_data},
    "calmar_ratio" : {"returns" : single_return_data}
}
performance = Performance.performance_dashboard(*args, **kwargs)
  • Plotting part

from performance_analysis.Plotting import Plotting
# read data, set index and convert to datatime
single_return_data = pd.read_csv("./single_return_data.csv")
single_return_data.set_index(['Date'],inplace=True)
single_return_data.index = pd.to_datetime(single_return_data.index, format='%Y%m%d', errors='coerce')

Plotting.plot_cum_return_and_drawdown(single_return_data)
Plotting.plot_monthly_return_heatmap(single_return_data, show_text = True)
Plotting.plot_seasonal_effect(single_return_data)

License

Distributed under the terms of the ‘MIT’_ license, “performance-analysis” is free and open source software

Metadata

Release files for performance-analysis 0.1.8

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

Source distribution (sdist)

Source distribution for performance-analysis 0.1.8
File Size Uploaded Provenance
performance-analysis-0.1.8.tar.gz 10.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for performance-analysis 0.1.8
File Interpreter ABI Platform
performance_analysis-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 19.8 kB

Release files / performance-analysis-0.1.8.tar.gz

Download URL performance-analysis-0.1.8.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a39284d34e2e818d2ceadcc0af391ca6232861077178ec430538d2e42df177b2
BLAKE2b-256 checksum
How to use checksums
efb83e4136df0a2ba98e41d9470da52a13f7da72d1a391f06a2bfe8ef5580f6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.8.13 Darwin/22.2.0

Release files / performance_analysis-0.1.8-py3-none-any.whl

Download URL performance_analysis-0.1.8-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4efa54cc0b65c791d0e2f51c47f6ba4f80858cd5c7f1b03d2caf19f3017c4e3f
BLAKE2b-256 checksum
How to use checksums
3f2954388fdd472a3366ac98a3c3023d4d8f4fd291d538ed230b7472c612c740
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.14 CPython/3.8.13 Darwin/22.2.0

Security for performance-analysis 0.1.8

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