bayesline.api.equity.AsyncPortfolioApi.get_portfolio

bayesline.api.equity.AsyncPortfolioApi.get_portfolio#

abstract async AsyncPortfolioApi.get_portfolio(names: list[str] | str, start_date: str | date | datetime | None = None, end_date: str | date | datetime | None = None, id_type: Literal['bayesid', 'ticker', 'composite_figi', 'cik', 'cusip8', 'cusip9', 'isin', 'sedol6', 'sedol7', 'proxy', 'name'] | None = None) DataFrame#

Obtains the portfolios for the given names between given start and end dates.

Parameters#

names: list[str] | str

The list of portfolio names.

start_date: DateLike, optional

The start date of the data to return, inclusive.

end_date: DateLike, optional

The end date of the data to return, inclusive.

id_type: IdType, optional

id type to return the portfolio holdings in.

Returns#

pl.DataFrame:

A dataframe with columns portfolio_group, portfolio, date, input_asset_id, input_asset_id_type, asset_id, asset_id_type and value.

If no id_type is given then the input ID space will be used unmapped. In this case the columns asset_id, asset_id_type will not be returned.