I tried to get the Holiday List using Eikon API in Python but no help, can we get in Python pandas dataframe so that we can use it and play with it ? Please see attached my query in python script.
Hi anonymous user
You can get the similar output using one of the endpoints and refinitiv-data library
import refinitiv.data as rdimport pandas as pdrd.open_session()url = "https://api.refinitiv.com/analytics/functions/v1/common/list-holidays"body = { "universe": [ {"startDate": "2023-01-01", "endDate": "2023-12-29", "calendarCodes": ["USA"]} ]}request = rd.delivery.endpoint_request.Definition( method=rd.delivery.endpoint_request.RequestMethod.POST, url=url, body_parameters=body,)response = request.get_data()pd.DataFrame(response.data.raw["data"][0]["holidays"])
To get the calendarCodes from currency code:
url = "https://api.refinitiv.com/analytics/functions/v1/fx/fx-info"body = {"universe": [{"currencyCodes": ["USD"]}]}request = rd.delivery.endpoint_request.Definition( method=rd.delivery.endpoint_request.RequestMethod.POST, url=url, body_parameters=body,)response = request.get_data()response.data.raw
Hi anonymous user ,
Thank you for your question. I believe the correct RIC for UK Holidays is 'GB/HOLIDAY' and for Ireland is 'NXT/HOLIDAY'.
Could you please try with this ticker and see if that resolves your issue?
Best regards,
Haykaz
Hi @aramyan.h, Thanks for above, however it is not helpful to our purpose. Can't we have the data based on HOL app using Python Eikon API, shown in the attached snapshot, where there is a option pull excel to get proper way in a table format for Holiday list, I want exactly in same in Pandas Python dataframe.
For Ireland specific you can use "IRL"
@m.bunkowski , thank you very much. This would be my last query under this request/blog : Where can I get all the "calendarCodes" based on country ?
anonymous user
I can recommend you to use the second enpoint as a discovery reference and please use ISO_4217 standard currency codes. That also accepts historical codes like:FRF for French Franc --> FRA
IEP for Irish Pound --> IRL
Hi team,
is there a calendar code that references the whole universe aka all the countries?
Thanks
@LilyC
You can use the following code in LD Library to retrieve the list of all calendars.
request_definition = ld.delivery.endpoint_request.Definition( url = '/data/quantitative-analytics-dates-and-calendars/v1/calendars', method = ld.delivery.endpoint_request.RequestMethod.GET ) response = request_definition.get_data() response.data.raw
The sample code is on GitHub.