bayesline.api.equity.ReportPersister#

class bayesline.api.equity.ReportPersister#

Abstract base class for report persisters.

This class defines the interface for persisting and loading portfolio reports.

__init__()#

Methods

__init__()

delete_persisted(name_or_id)

Delete persisted reports by name or ID.

load_persisted(name_or_id)

Load a persisted report by name or ID.

persist(name, settings, accessors)

Persist a report with the given name and settings.

abstract persist(name: str, settings: ReportAccessorSettings, accessors: Sequence[ReportAccessorApi]) int#

Persist a report with the given name and settings.

Parameters#

namestr

The name to persist the report under.

settingsReportAccessorSettings

The settings for the report.

accessorsSequence[ReportAccessorApi]

The accessors for the report.

Returns#

int

A globally unique identifier of the persisted report.

abstract load_persisted(name_or_id: str | int) ReportAccessorApi#

Load a persisted report by name or ID.

Parameters#

name_or_idstr | int

The name or ID of the persisted report.

Returns#

ReportAccessorApi

The loaded report accessor API.

abstract delete_persisted(name_or_id: list[str | int]) None#

Delete persisted reports by name or ID.

Parameters#

name_or_idlist[str | int]

The names or IDs of the persisted reports to delete.