bayesline.api.equity.AsyncPortfolioHoldingsReportApi#
- class bayesline.api.equity.AsyncPortfolioHoldingsReportApi#
API for a universe count report.
- __init__()#
Methods
__init__()calculate(portfolio_names, start_date, ...)Calculate the portfolio holdings report.
calculate_as_task(portfolio_names, ...)Calculate the portfolio holdings report as a task.
get_maybe_cached(portfolio_names, ...)Get the cached portfolio holdings 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 async get_maybe_cached(portfolio_names: list[str] | None, start_date: str | date | datetime | None, end_date: str | date | datetime | None, **kwargs: Any) AsyncPortfolioHoldingsReportAccessor | None#
Get the cached portfolio holdings report accessor API if it is available.
Parameters#
- portfolio_nameslist[str] | None
The names of the portfolios to calculate the report for. If None, all portfolios will be calculated. For nested portfolios, the names must be given in the format “portfolio:held_portfolio”, with multiple separators indicating deeper nesting. If nested portfolios are given, unpack must be True in the report settings.
- start_dateDateLike | None
The start date of the report.
- end_dateDateLike | None
The end date of the report.
- **kwargs: Any
Additional keyword arguments.
Returns#
- AsyncPortfolioHoldingsReportAccessor | None
The cached portfolio holdings report accessor API, or None if the report is not cached.
- abstract async calculate(portfolio_names: list[str] | None, start_date: str | date | datetime | None, end_date: str | date | datetime | None, **kwargs: Any) AsyncPortfolioHoldingsReportAccessor#
Calculate the portfolio holdings report.
Parameters#
- portfolio_nameslist[str] | None
The names of the portfolios to calculate the report for. If None, all portfolios will be calculated. For nested portfolios, the names must be given in the format “portfolio:held_portfolio”, with multiple separators indicating deeper nesting. If nested portfolios are given, unpack must be True in the report settings.
- start_dateDateLike | None
The start date of the report.
- end_dateDateLike | None
The end date of the report.
- **kwargs: Any
Additional keyword arguments.
Returns#
- AsyncPortfolioHoldingsReportAccessor
The portfolio holdings report accessor.
- abstract async calculate_as_task(portfolio_names: list[str] | None, start_date: str | date | datetime | None, end_date: str | date | datetime | None, **kwargs: Any) AsyncTask[AsyncPortfolioHoldingsReportAccessor]#
Calculate the portfolio holdings report as a task.
Parameters#
- portfolio_nameslist[str] | None
The names of the portfolios to calculate the report for. If None, all portfolios will be calculated. For nested portfolios, the names must be given in the format “portfolio:held_portfolio”, with multiple separators indicating deeper nesting. If nested portfolios are given, unpack must be True in the report settings.
- start_dateDateLike | None
The start date of the report.
- end_dateDateLike | None
The end date of the report.
- **kwargs: Any
Additional keyword arguments.
Returns#
- AsyncTask[PortfolioHoldingsReportAccessor]
The task for the portfolio holdings report accessor.