Investment Lists#

morningstar_data.direct.user_items.get_investment_list(
list_id: str,
) DataFrame#

Returns all investments that belong to a saved investment list in Morningstar Direct. Currently, this function does not support lists that combine investments and user-created portfolios.

Parameters:

list_id (str) – The unique identifier of a saved investment list in Morningstar Direct. The format is GUID. For example, “EBE416A3-03E0-4215-9B83-8D098D2A9C0D”.

Returns:

A DataFrame object with investments that belong to the specified list. DataFrame columns include:

  • secid

  • masterportfolioid

  • tradingsymbol

  • name

  • securitytype

  • exchangeid

  • category

Return type:

DataFrame

Examples

Get investment list with id “385349FE-01D6-4064-B297-64EAA28BD4E9”.

import morningstar_data as md

df = md.direct.user_items.get_investment_list(list_id="385349FE-01D6-4064-B297-64EAA28BD4E9")
df
Output:

secid

masterportfolioid

tradingsymbol

name

securitytype

exchangeid

category

XIUSA000KQ

24729

NaN

Russell 2000 Growth TR USD XI

NaN

Small

Growth

morningstar_data.direct.user_items.get_investment_lists() DataFrame#

Returns all investment lists saved or shared to a user in Morningstar Direct. Also includes Morningstar pre-defined investment lists. Currently, this function does not support lists that combine investments and user-created portfolios.

Returns:

A DataFrame object containing investment list details. DataFrame columns include:

  • id

  • name

Return type:

DataFrame

Examples:

import morningstar_data as md

df = md.direct.user_items.get_investment_lists()
df
Output:

id

name

EBE416A3-03E0-4215-9B83-8D098D2A9C0D

Morningstar Open Index Project

858BD493-68B3-4D44-9DF0-333D3CC88A1C

Morningstar Prospects

morningstar_data.direct.user_items.save_investment_list(
list_name: str,
investment_ids: List[str],
overwrite_if_exists: bool,
) DataFrame#

Saves or updates an investment list. Currently, this function does not support lists that combine investments and user-created portfolios.

Parameters:
  • list_name (str) – Name of the list

  • investment_ids (list) – List of investment ids (SecId). For example: [“F00000YVYF”,”FOUSA00CFV”]

  • overwrite_if_exists (bool) – If True the list will be overwritten

Returns:

A DataFrame object with the new investment list data.

Return type:

DataFrame

Create new list:

DataFrame columns include:

  • Name

  • List Id

  • Investments

  • Created Date

Examples:

import morningstar_data as md

df = md.direct.user_items.save_investment_list(
    list_name="new_investments",
    investment_ids=["F00000YVYF", "FOUSA00CFV"],
    overwrite_if_exists=False
)
df
Output:

Status

Name

List Id

Investments

Created Date

List successfully created

new_investments

295F7E59-15AC-4424-958E-3BD8B0A733EE

[F00000YVYF, FOUSA00CFV]

2022-03-29T14:43:00

Update existing list:

The returned DataFrame columns include:

  • Name

  • List Id

  • Modified Date

Examples:

import morningstar_data as md

df = md.direct.user_items.save_investment_list(
    list_name="new_investments",
    investment_ids=["F00000YVYF", "FOUSA00CFV"],
    overwrite_if_exists=True
)
df
Output:

Status

Name

List Id

Modified Date

List successfully updated

new_investments

295F7E59-15AC-4424-958E-3BD8B0A733EE

2022-03-29T14:45:00