Lookup#
- morningstar_data.direct.get_data_point_settings(
- data_point_ids: List[str],
Returns settings for a given set of data points. This settings DataFrame can be manipulated to reflect specific settings to be used for data retrieval.
- Parameters:
data_point_ids (
list
) – A list of unique identifiers for data points. Example: [“OS01W”, “HP010”]- Returns:
DataFrame: A DataFrame object with data point settings. DataFrame columns include:
datapointId
datapointName
displayName
currency
preEuroConversion
sourceId
frequency
startDate
endDate
floatStart
floatEnd
startDelay
endDelay
diffStart
diffEnd
compounding
calculationId
annualized
annualDays
benchmark
riskfree
windowType
windowSize
stepSize
requireContinueData
fit
scalType
scalValue
scalPercentValue
timehorizon
- Examples:
Get data point settings for data point “OS01W”.
import morningstar_data as md df = md.direct.get_data_point_settings(data_point_ids=["OS01W"]) df
- Output:
datapointId
datapointName
…
calcMnav
showType
transType
OS01W
Name
…
None
None
None
- Errors:
AccessDeniedError: Raised when the user is not authenticated.
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.
- morningstar_data.lookup.currency_codes(
- keyword: str | None = None,
Returns currency codes and currency name that match the given keyword. If no keyword is provided, the function returns all currency codes and currency names.
- Parameters:
keyword (Optional[str], optional) – A string used to lookup currency codes. Example: “USD”. Returns matching currency code for the keyword ‘USD’.
- Returns:
DataFrame: Returns a DataFrame. The DataFrame columns include:
currency_code
currency_name
- Examples:
Search currency codes based on keyword “Afgh”
import morningstar_data as md df = md.lookup.currency_codes( keyword="Afgh" ) df
- Output:
currency_code
currency_name
AFN
Afghani
- Errors:
AccessDeniedError: Raised when the user is not authenticated.
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 a currency code matching the given keyword does not exist.
- morningstar_data.direct.lookup.investments(
- keyword: str = '',
- investment: InvestmentIdentifier | None = None,
- count: int = 50,
- only_surviving: bool = True,
Returns investments that match the given keyword or
InvestmentIdentifier
object.- Parameters:
keyword (
str
, optional) – Keyword to search for investments.investment (
InvestmentIdentifier
, optional) – Identifies an investment by its ISIN, CUSIP, ticker, base currency, and/or exchange.count (
int
, optional) – Maximum number of matching investments to return.only_surviving (
bool
, optional) – Include only surviving investments.
Note
You must specify one of, but not both of
keyword
orinvestment
.- Returns:
DataFrame: A DataFrame containing the matching investments with the following columns:
Name
SecId: Morningstar’s unique identifier for this investment
Ticker
ISIN
CUSIP
Base Currency
Exchange: The exchange where the investment is listed
Country: The country where the investment is based
Security Type: Morningstar security type code for this investment
Fund Id
Performance Id
- Examples:
1. Find all global listings for a security by its ticker symbol
import morningstar_data as md from morningstar_data.direct import InvestmentIdentifier # Define an investment identifier investment = InvestmentIdentifier(ticker="AAPL") # Retrieve matching investments df = md.direct.lookup.investments(investment=investment) df
Name
SecId
Ticker
ISIN
CUSIP
Base Currency
Exchange
Country
Security Type
Fund Id
Performance Id
Apple Inc
0P000000GY
AAPL
US0378331005
037833100
USD
EXXNAS
USA
ST
None
0P000000GY
Apple Inc
0P0001367D
AAPL
US0378331005
037833100
USD
EXXSGO
USA
ST
None
0P0001367D
…
…
…
…
…
…
…
…
…
…
…
Apple Inc
0P0001KOM0
AAPL
US0378331005
037833100
USD
EXXLIM
USA
ST
None
0P0001KOM0
Apple Inc
0P0000EEPX
AAPL
US0378331005
037833100
EUR
EXXWBO
USA
ST
None
0P0000EEPX
2. Get listings using ticker symbol and base currency
import morningstar_data as md from morningstar_data.direct import InvestmentIdentifier # Define an investment identifier investment = InvestmentIdentifier(ticker="AAPL", base_currency="Canadian Dollar") # Retrieve matching investments df = md.direct.lookup.investments(investment=investment) df
Name
…
Base Currency
Exchange
Country
…
Performance Id
Apple Inc Canadian Depository Receipt (CAD Hedged)
…
CAD
EXXTSE
USA
…
0P0001N6JJ
Apple Inc
…
CAD
EXXNAS
USA
…
0P000000GY
3. Get listings using ISIN
import morningstar_data as md from morningstar_data.direct import InvestmentIdentifier # Define an investment identifier investment = InvestmentIdentifier(isin="US5949181045") # Retrieve matching investments df = md.direct.lookup.investments(investment=investment) df
Name
SecId
Ticker
ISIN
…
PerformanceId
Microsoft Corp
0P000003MH
MSFT
US5949181045
…
0P000003MH
Microsoft Corp
0P0000BNJR
MSF
US5949181045
…
0P0000BNJR
Microsoft Corp
0P0000EGEI
MSF
US5949181045
…
0P0000EGEI
Microsoft Corp
0P0001AJSV
MSFT
US5949181045
…
0P0001AJSV
- morningstar_data.direct.firms(
- keyword: str,
- universe: str | None = None,
Returns firms that match the given keyword.
- Parameters:
keyword (
str
) – Keyword to search for firms.universe (
str
, optional) – Investment universe code. Example: “FO”. Use get_investment_universes to discover possible values.
- Returns:
DataFrame: A DataFrame object with firms. DataFrame columns include:
Id
Firm Name
Universe
- Examples:
Get all firms that match the keyword “rock”.
import morningstar_data as md df = md.direct.lookup.firms("rock") df
- Output:
Id
Firm Name
Universe
F00000Z17E
Amrock Capital B.V.
FO
F00000XC6D
BlackRock
FO
F00000SEJ6
BlackRock (Channel Islands) Limited
FO
…
- Errors:
AccessDeniedError: Raised when the user is not authenticated.
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.
- morningstar_data.direct.get_brandings(
- keyword: str,
- find_by: str,
- universe: str | None = None,
Returns brandings for the given universe and keyword.
- Parameters:
keyword (
str
) – Keyword to search for brandings.find_by (
str
) – Search condition to search for brandings. Valid values arename_begin
andname_contain
.universe (
str
, optional) –Investment universe code. Example: “FO”. Use get_investment_universes to discover possible values.
- Returns:
DataFrame: A DataFrame object with brandings. DataFrame columns include:
Id
Name
- Examples:
Search brandings in the open-end fund universe, where branding name begins with the keyword “a”.
import morningstar_data as md df = direct.lookup.get_brandings("a", "name_begin", "FO") df
- Output:
Id
Name
BN000007Q5
A Plus Finance
BN000007Q6
A&G
BN00000GBI
A1
…
- Errors:
BadRequestException: Raised when the parameter find_by is not a valid value.
AccessDeniedError: Raised when the user is not authenticated.
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.
- morningstar_data.direct.lookup.portfolio_managers(
- keyword: str = '',
- universe: str = 'FO',
Returns portfolio managers for the given universe and keyword.
- Parameters:
keyword (
str
) – String to match one or more manager names. If the keyword is empty or not passed to the function, the function will return all managers.universe (
str
) –Investment universe code. Example: “FO”. Use get_investment_universes to discover possible values.
- Returns:
DataFrame: A DataFrame object with portfolio managers. DataFrame columns include:
Id
Manager Name
Firm
- Examples:
Get portfolio managers that match the keyword “alla”.
import morningstar_data as md df = md.direct.lookup.portfolio_managers(keyword="alla") df
- Output:
Id
Manager name
Firm
81643
Abdallah Guezour
Schroders
123653
Abdallah Nauphal
TD
213243
Adam Rizkalla
River Canyon
153647
Adrian Allardice
Old Mutual
182699
Adrian van Pallander
Coronation
…
- Errors:
AccessDeniedError: Raised when the user is not authenticated.
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.
- morningstar_data.direct.lookup.companies(
- keyword: str = '',
- universe: str = 'ST',
Returns companies for the given universe and keyword.
- Parameters:
keyword (
str
) – String to match one or more company names. If the keyword is empty or not passed to the function, the function will return all companies.universe (
str
) –Investment universe code. Example: “FO”. Use get_investment_universes to discover possible values.
- Returns:
DataFrame: A DataFrame object with companies. DataFrame columns include:
Id
Company name
- Examples:
Get companies that match the keyword “Energy”.
import morningstar_data as md df = md.direct.lookup.companies("Energy") df
- Output:
Id
Company name
0C00008O2A
11 Good Energy Inc
0C000017RQ
2G Energy AG
0C0000516I
3MV Energy Corp
0C00000ZAZ
3Power Energy Group Inc
0C00000QLB
3TEC Energy Corp
…
- Errors:
AccessDeniedError: Raised when the user is not authenticated.
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.
- morningstar_data.direct.lookup.get_investment_universes(
- include_category_universes: bool = False,
Returns investment universe names and IDs. For example, Bonds, eVestment Hedge Funds, Global Restricted Funds.
- Parameters:
include_category_universes (
bool
, optional) – If True, the function will return all universes, including category universes. Default is False.- Returns:
DataFrame: A DataFrame object with universes. DataFrame columns include:
Id
Name
- Examples:
import morningstar_data as md df = md.direct.lookup.get_investment_universes() df
- Output:
Id
Name
FH
Hedge Funds
XI
Market_Indexes
…