Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 0 2

Sdate & Edate python api

Hi, Below is my code :

etf_esg, err = ek.get-data('0#.'XUTUM', ['TR.TRESGScore','TR.TRESGCScore','TR.EnvironmentPillarScore'])

I know as some companies in XUTUM having already published their score 2022, others haven't yet, some securities have the data begin in 2022 / others in 2021.

I need a python code for me to get both 2021 and 2022 scores in "excel output" so that they will be show in two seperate columns.

Regards,

eikon-data-apipython api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvote
Accepted
166 2 0 3

Hi gaye.sakarya,


You may try following codes:

etf_esg, err = ek.get_data('0#.XUTUM', ['TR.TRESGScore.date','TR.TRESGScore','TR.TRESGCScore','TR.EnvironmentPillarScore'],

{'SDate':'0', 'EDate':'-2','Period':'FY0','Frq':'FY'})

etf_esg['Date']=etf_esg['Date'].astype('str')

etf_esg['Date']=etf_esg['Date'].apply(lambda x: x[:10])

etf_esg = etf_esg[etf_esg['Date']>='2021']

etf_esg


api.png


api.png (79.3 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi Frank, thanks for


I want to see both 2021 and 2022 scores of companies. When I ran your code, only the notes for the end of December 2021 came up. How can I see both 2021 and 2022 scores?


There is one company (DOCO.IS) that released ESG content on 2022-03-31.

api.png

If you know there is other companies who released 2022 ESG score, would you please check if they're already available in Eikon desktop?


api.png (29.9 KiB)

thanks. I did it thanks to your code. So how do you think I can run this code automatically? I tried to do it with Task Scheduler, but when my computer opens python exe, this code does not run. Because I am using anaconda. I can run with anaconda prompt. On the other hand, I have tried .bat file format.


Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.