Lookup#

morningstar_data.direct.get_data_point_settings(
data_point_ids: List[str],
) DataFrame#

Returns a DataFrame of settings for a given set of data points. This settings DataFrame can then be manipulated to reflect the specific settings to be used for data retrieval.

Parameters:

data_point_ids (list) – A list of unique identifiers for data points. The format is an array of data point id. Example: [“OS01W”, “HP010”]

Returns:

A DataFrame object with data point settings data. The 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

Return type:

DataFrame

Examples

Get data point setting for data point id “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 permissions to access the requested resource.

InternalServerError: Raised when the server encounters an error it does not know how to handle.

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,
) DataFrame#

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:

Returns a DataFrame. The DataFrame columns include:

  • currency_code

  • currency_name

Return type:

DataFrame

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 permissions to access the requested resource.

InternalServerError: Raised when the server encounters an error it does not know how to handle.

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.investments(
keyword: str,
count: int = 50,
only_surviving: bool = True,
) DataFrame#

Returns a DataFrame of investments that match the given keyword.

Parameters:
  • (obj (only_surviving) – str): Keyword to search for investments.

  • (objint, optional): Maximum no. of investments to return that match the keyword.

  • (objbool, optional): Include Only Surviving investments.

Returns:

A DataFrame object with investments data. The DataFrame columns include:

  • Name

  • SecId

  • Ticker

  • ISIN

  • CUSIP

  • Base Currency

  • Exchange

  • Country

  • Security Type

  • Fund Id

  • Performance Id

Return type:

DataFrame

Examples

Get investment list that match the keyword “fixed”.

import morningstar_data as md

df = md.direct.lookup.investments(keyword="fixed")
df
Output:

Errors:

AccessDeniedError: Raised when the user is not authenticated.

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

InternalServerError: Raised when the server encounters an error it does not know how to handle.

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.firms(
keyword: str,
universe: str | None = None,
) DataFrame#

Returns a DataFrame of firms that match the given keyword.

Parameters:
  • (obj (keyword) – str): Keyword to search for firms.

  • universe (str, optional) – The Morningstar code for an investment universe.

Returns:

A DataFrame object with firms data. The DataFrame columns include:

  • Id

  • Firm Name

  • universe

Return type:

DataFrame

Examples

Get firm list 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 permissions to access the requested resource.

InternalServerError: Raised when the server encounters an error it does not know how to handle.

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,
) DataFrame#

Returns a DataFrame of Branding Name for the given universe and keyword.

Parameters:
  • keyword(objstr): Keyword to search for investments.

  • find_by(objstr): Search condition to search for investments. Valid values are name_begin and name_contain.

  • universe(objstr, optional): Maximum no. of investments to return that match the keyword.

Returns:

A DataFrame object with Branding Name and Branding Id. The DataFrame columns include:

  • Name

  • Id

Return type:

DataFrame

Examples

Search Branding with branding name begin with keyword a in open-end fund.

import morningstar_data as md

df = direct.lookup.get_brandings("a", "name_begin", "FO")
df
Output:

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 permissions to access the requested resource.

InternalServerError: Raised when the server encounters an error it does not know how to handle.

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',
) DataFrame#

Returns a DataFrame of 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 a Dataframe with all managers.

  • universe (str) – The Morningstar code for an investment universe. Use get_all_universes to see a full list of codes, or view the documentation here.

Returns:

A DataFrame object with managers data. The DataFrame columns include:

  • Id (Manager Id)

  • Manager Name

  • Firm (Firm Name)

Return type:

DataFrame

Examples

Get managers list 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 permissions to access the requested resource.

InternalServerError: Raised when the server encounters an error it does not know how to handle.

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',
) DataFrame#

Returns a DataFrame of 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 a Dataframe with all companies.

  • universe (str) –

    The Morningstar code for an investment universe. Use get_all_universes to see a full list of codes, or view the documentation here.

Returns:

A DataFrame object with companies data. The DataFrame columns include:

  • Id (Company Id)

  • Company name

Return type:

DataFrame

Examples

Get company list 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 permissions to access the requested resource.

InternalServerError: Raised when the server encounters an error it does not know how to handle.

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.