bayesline.api.equity.AsyncReportApi#

class bayesline.api.equity.AsyncReportApi#

A base interface for report APIs.

It is meant to be extended by several more concrete interfaces which narrow down the set of possible args and kwargs to a more specific set, e.g. for the subset of possible reports that require a start and end date.

__init__()#

Methods

__init__()

calculate(*args, **kwargs)

Triggers the calculation of the report and returns an accessor API.

calculate_as_task(*args, **kwargs)

get_maybe_cached(*args, **kwargs)

Get the cached report accessor API if it is available.

to_mermaid()

Get a Mermaid diagram of the report execution graph.

Attributes

settings

The settings used to create this report.

abstract property settings: S#

The settings used to create this report.

Returns#

S

The settings used to create this report.

abstract async get_maybe_cached(*args: ~typing.~P, **kwargs: ~typing.~P) AT | None#

Get the cached report accessor API if it is available.

Parameters#

*args: P.args

The arguments to the report calculation.

**kwargs: P.kwargs

The keyword arguments to the report calculation.

Returns#

T | None

The cached report accessor API, or None if the report is not cached.

abstract async calculate(*args: ~typing.~P, **kwargs: ~typing.~P) AT#

Triggers the calculation of the report and returns an accessor API.

Parameters#

*args: P.args

The arguments to the report calculation.

**kwargs: P.kwargs

The keyword arguments to the report calculation.

Returns#

T

The accessor API for the report result.

abstract async calculate_as_task(*args: ~typing.~P, **kwargs: ~typing.~P) AsyncTask[AT]#
abstract async to_mermaid() str#

Get a Mermaid diagram of the report execution graph.

Returns#

str

The Mermaid diagram of the report.