Holdings Data#
- morningstar_data.direct.get_holding_dates(
- investment_ids: List[str],
Returns all portfolio dates of available holdings for a given investment or set of investments.
- Parameters:
investment_ids (
list
) – An array of investment codes. The investment code format is secid;universe. For example: [“F00000YOOK;FO”,”FOUSA00CFV;FO”].- Returns:
A DataFrame object with portfolio date data. The DataFrame columns include:
- Return type:
DataFrame
secId
masterPortfolioId
date
suppression
suppressionHoldingNumber
Examples
Search holdings of investment “FOUSA00KZH;FO”.
import morningstar_data as md df = md.direct.get_holding_dates(investment_ids=["FOUSA06JNH"]) df
- Output:
secId
masterPortfolioId
date
suppression
suppressionHoldingNumber
FOUSA06JNH
210311
2021-08-31
False
None
FOUSA06JNH
210311
2021-07-31
False
None
…
- morningstar_data.direct.get_holdings(
- investment_ids: List[str],
- date: str | None = None,
- start_date: str | None = None,
- end_date: str | None = None,
Returns holdings for a given investment or set of investments during a specified date or date range. If the date is not specified, the function returns the latest portfolio date by default.
- Parameters:
investment_ids (
list
) – An array of investment codes. The investment code format is secid;universe. For example: [“F00000YOOK;FO”,”FOUSA00CFV;FO”].date (
str
, optional) – The specific date on which to retrieve data. The format is YYYY-MM-DD. For example, “2020-01-01”. If a date is provided, then the start_date and end_date parameters are ignored. An exception is thrown if start_date or end_date is provided along with date.start_date (
str
, optional) – The beginning date of a data range for retrieving data. The format is YYYY-MM-DD. For example, “2020-01-01”. An exception is thrown if date is provided along with start_date.end_date (
str
, optional) – The end date of data range for retrieving data. If no value is provided for end_date, current date will be used. The format is YYYY-MM-DD. For example, “2020-01-01”. An exception is thrown if date is provided along with end_date.
- Returns:
A DataFrame object with holdings data. The DataFrame columns include:
investmentId
masterPortfolioId
portfolioDate
holdingId
bondId
name
secId
isin
cusip
weight
shares
marketValue
sharesChanged
currency
ticker
detailHoldingType
- Return type:
DataFrame
- Raises:
ValueErrorException – When investment_ids parameter is invalid, then an error will occur.
Examples
Search holdings of investment “FOUSA00KZH;FO” on “2020-12-31”.
import morningstar_data as md df = md.direct.get_holdings(investment_ids=["FOUSA00KZH;FO"], date="2020-12-31") df
- Output:
investmentId
masterPortfolioId
…
ticker
detailHoldingType
FOUSA00KZH;FO
6079
…
CBRE
EQUITY
FOUSA00KZH;FO
6079
…
GOOGL
EQUITY
…