Portfolio List#

morningstar_data.direct.user_items.get_portfolios(
portfolio_type: str | None = None,
) DataFrame#

Returns all portfolios for the given portfolio type.

Parameters:

portfolio_type (str) – The portfolio type. The available options are: model_portfolios, custom_benchmarks.

Returns:

DataFrame: A DataFrame object with portfolio details. DataFrame columns include:

  • PortfolioId

  • Name

  • Type

Examples:

Get client account portfolios.

import morningstar_data as md

df = md.direct.user_items.get_portfolios(portfolio_type = "model_portfolios")
df
Output:

PortfolioId

Name

Type

3d25b613-ae42-4cb6-bd05-7ba7c74883f3;MD

Portfolio1

model_portfolios

5d25b613-ae42-4cb6-bd05-7ba7c74883f3;MD

Portfolio2

model_portfolios

Errors:

AccessDeniedError: Raised when the user is not authenticated.

BadRequestError: Raised when the user does not provide a properly formatted request.

ForbiddenError: Raised when the user does not have permission to access the requested resource.

InternalServerError: Raised when the server encounters an unhandled error.

NetworkExceptionError: Raised when the request fails to reach the server due to a network error.

ResourceNotFoundError: Raised when the requested resource does not exist in Direct.