bayesline.api.equity.PortfolioReturnsReportApi#
- class bayesline.api.equity.PortfolioReturnsReportApi#
API for a portfolio returns report.
- __init__()#
Methods
__init__()calculate(portfolio_names, start_date, ...)Calculate the portfolio returns report.
calculate_as_task(portfolio_names, ...)Calculate the portfolio returns report as a task.
get_maybe_cached(portfolio_names, ...)Get the cached portfolio returns report accessor API if it is available.
to_mermaid()Get a Mermaid diagram of the report execution graph.
Attributes
settingsThe settings used to create this report.
- abstract get_maybe_cached(portfolio_names: list[str] | None, start_date: str | date | datetime | None, end_date: str | date | datetime | None, **kwargs: Any) PortfolioReturnsReportAccessor | None#
Get the cached portfolio returns report accessor API if it is available.
Parameters#
- portfolio_names: list[str] | None
The names of the portfolios to calculate the report for. If None, all portfolios will be calculated.
- start_date: DateLike | None
The start date of the report.
- end_date: DateLike | None
The end date of the report.
- **kwargs: Any
Additional keyword arguments.
Returns#
- PortfolioReturnsReportAccessor | None
The cached portfolio returns report accessor API, or None if the report is not cached.
- abstract calculate(portfolio_names: list[str] | None, start_date: str | date | datetime | None, end_date: str | date | datetime | None, **kwargs: Any) PortfolioReturnsReportAccessor#
Calculate the portfolio returns report.
Parameters#
- portfolio_names: list[str] | None
The names of the portfolios to calculate the report for. If None, all portfolios will be calculated.
- start_date: DateLike | None
The start date of the report.
- end_date: DateLike | None
The end date of the report.
- **kwargs: Any
Additional keyword arguments.
Returns#
- PortfolioReturnsReportAccessor
The portfolio returns report accessor.
- abstract calculate_as_task(portfolio_names: list[str] | None, start_date: str | date | datetime | None, end_date: str | date | datetime | None, **kwargs: Any) Task[PortfolioReturnsReportAccessor]#
Calculate the portfolio returns report as a task.
Parameters#
- portfolio_names: list[str] | None
The names of the portfolios to calculate the report for. If None, all portfolios will be calculated.
- start_date: DateLike | None
The start date of the report.
- end_date: DateLike | None
The end date of the report.
- **kwargs: Any
Additional keyword arguments.
Returns#
- Task[PortfolioReturnsReportAccessor]
The task for the portfolio returns report accessor.