The country of risk can be obtained using the datastream excel add-in with the function: =TR(RIC code,"TR.CoRPrimaryCountry"), whereas I cannot find how to retrieve the country of risk for a countryparty with the Python API.
The country of risk can be obtained using the datastream excel add-in with the function: =TR(RIC code,"TR.CoRPrimaryCountry"), whereas I cannot find how to retrieve the country of risk for a countryparty with the Python API.
Hello @Salih.Bagci
Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?
If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.
Thanks,
AHS
Dear Bagci,
"TR.CoRPrimaryCountry" is a field used to collect data (in this case: 'Country of Risk') from Refinitiv Workspace (a.k.a.: Eikon). This field can be used with the Eikon Data API for any stock (e.g.: Apple with the RIC '@AAPL') via the following code in Python:
import eikon as ek ek.set_app_key("insert eikon key here") df, err = ek.get_data(instruments = ['@AAPL'], fields = ['TR.CoRPrimaryCountry'], parameters = {'SDate':'0', 'EDate':'-19', 'Period':'FY0', 'Frq':'FY'}) df
Datastream dos not - unfortunately - have such a field. You may find a list of all the fields available from Datastream in the document attached: Datastream fields for AAPL.txt