Skip to main content

No project description provided

Project description

aplotly

Installation

pip install areport

Usage

For examples please refer to the code in the examples folder.

Report

The Report class contains the methods for computing common metrics and storing them to files. The class is initialized with a list of portfolio values. These values should always start with the initial value of 1, otherwise the class will raise an error.

from areport import Report

report = Report([1.0, 1.1, 1.2])

ReportComparison

The ReportComparison class contains the methods for comparing multiple reports. The class is initialized with one Report that is treated as the portfolio, and a dictionary of other Report instances that are treated as benchmarks.

from areport import ReportComparison

report_comparison = ReportComparison(report, {'benchmark1': report1, 'benchmark2': report2})

Metrics

The common metrics can be retrieved using the following methods:

from areport import Report

report = Report([1.0, 1.1, 1.2])
report.get_metrics()

The same is also possible for the ReportComparison class:

from areport import ReportComparison

report_comparison = ReportComparison(report, {'benchmark1': report1, 'benchmark2': report2})
report_comparison.get_metrics()

If you want to save the metrics to a file, you can use the metrics_to_{format} method:

from areport import Report

report = Report([1.0, 1.1, 1.2])
report.metrics_to_csv('report.csv')
report.metrics_to_json('report.json')

The same is also possible for the ReportComparison class:

from areport import ReportComparison

report_comparison = ReportComparison(report, {'benchmark1': report1, 'benchmark2': report2})
report_comparison.metrics_to_csv('report_comparison.csv')
report_comparison.metrics_to_json('report_comparison.json')

Using with aplotly

This package can be combined with the aplotly package to create interactive plots. The aplotly package is a wrapper around the plotly package that simplifies the creation of plots. The useful attrbutes of the Report class are pf_values and dt_pf_values. Here is an example of how to use the aplotly package with the Report class to create the performance chart.

from aplotly.plots import plot_performance
from areport import Report

report = Report([1.0, 1.1, 1.2])

fig = plot_performance(
    report.performance_to_pct(report.dt_pf_values - 1)  # performance in percentage
    report.drawdown_to_pct(report.drawdown, report.dt_pf_values.index)  # drawdown in percentage
    performance_label="Test",
    drawdown_label="Test",
    xlabel="X",
)
fig.show()

Metrics

Detailed documentation for the metrics can be found on Notion

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

areport-1.0.37.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

areport-1.0.37-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file areport-1.0.37.tar.gz.

File metadata

  • Download URL: areport-1.0.37.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for areport-1.0.37.tar.gz
Algorithm Hash digest
SHA256 3ef306d74d0df8ef1efc5215452eee2d606f22f1d1db3a716d0db763696fc1af
MD5 cd336c116f318fb946faf3875d7d25e7
BLAKE2b-256 1f49f2d616430cc875a446b89776b3ccc4c900720d814208400569baa01d7297

See more details on using hashes here.

File details

Details for the file areport-1.0.37-py3-none-any.whl.

File metadata

  • Download URL: areport-1.0.37-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for areport-1.0.37-py3-none-any.whl
Algorithm Hash digest
SHA256 dacbaaaf0084f0faf97dd34e16a3aa2d5123600c125297c17a05db9d33e772c5
MD5 072176c355a8067ed5b4cad3dc12068e
BLAKE2b-256 ce6397a3a403a7f957fb254553458690152945b707466953f00a1d7e4f639029

See more details on using hashes here.

Supported by

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