Investment Lists#
- morningstar_data.direct.user_items.get_investment_list(
- list_id: str,
Returns all investments that belong to a saved investment list in Morningstar Direct.
- Parameters:
list_id (
str
) – The unique identifier of a saved investment list in Morningstar Direct, e.g., “EBE416A3-03E0-4215-9B83-8D098D2A9C0D”. Use the get_investment_lists function to discover saved lists.- Returns:
DataFrame: A DataFrame object with investments that belong to the specified list. DataFrame columns include:
secid
masterportfolioid
tradingsymbol
name
securitytype
exchangeid
category
- Examples:
Get investment list by ID.
import morningstar_data as md df = md.direct.user_items.get_investment_list(list_id="385349FE-01D6-4064-B297-64EAA28BD4E9") # Replace with a valid List ID 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.
- Returns:
DataFrame: A DataFrame object containing investment list details. DataFrame columns include:
id
name
- 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,
Saves or updates an investment list.
- Parameters:
list_name (
str
) – Name of the listinvestment_ids (
list
) – List of investment IDs (SecId). For example: [“F00000YVYF”,”FOUSA00CFV”]overwrite_if_exists (
bool
) – If True the list will be overwritten
- Returns:
DataFrame: A DataFrame object with the new investment list data.
- Examples:
Example 1: Save a new investment list.
Output DataFrame columns include:
Status
Name
List Id
Investments
Created Date
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
…
Example 2: Update an existing list.
Output DataFrame columns include:
Status
Name
List Id
Modified Date
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
Status
Name
List Id
Modified Date
List successfully updated
new_investments
295F7E59-15AC-4424-958E-3BD8B0A733EE
2022-03-29T14:45:00
…