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
1 1 1 1

How to download green bond data in Green Bond Guide?

I am a python beginner but want to download green bond data in Green Bond Guide (GRNBNDG) using python api.

1633568400686.png
I find that the excel version of the data can be downloaded by clicking the excel button on the north east corner in the screenshot (the data attached), but I am struggling with figuring out the right python syntax.

I see 'GRNBNDG' is the name of Green Bond Guide and there is a Green Bond Flag.

1633569571455.png

so I have tried something like below, without luck.

ek.get_data('GRNBNDG',[*],{'TR.GreenBondFlag':'Y'})

Any hints/help would be appreciated!

pythonbonds
1633568400686.png (173.3 KiB)
1633569571455.png (51.8 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 @sando

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?
If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,
AHS

Hello @sando ,

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

-AHS

Upvote
Accepted
10.2k 18 6 9

@sando So probably the best way to go about this is to use the greenbond chain rics - which can offer the universe of green bonds, by currency, type etc. You can get these chain rics from this greenbonds guide screen:

1633609011996.png

So with any of these chains you can get a list of these RICS.

df, err = ek.get_data(['0#AUDAGYGRNBND'],['CF_Name'])
df

1633609618513.png

Once you have your list of instruments you can then request whatever fields you require:

df1, err = ek.get_data(df['Instrument'].astype(str).values.tolist(),['TR.FiMaturityDate'])
df1

There is an excellent article on working with chain objects here

I hope this can help.


1633609011996.png (355.8 KiB)
1633609618513.png (78.8 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.

Upvote
399 4 5 9

Dear @sando ,

If your goal is to retrieve data on green bonds which includes the field mentioned in Green Bonds Guide (excel file) I would suggest using Search RDP. The following query returns all green bonds with the fields from the excel you are referring to:

df = rdp.search(

    view = rdp.SearchViews.FixedIncomeInstruments,

    filter = "IsGreenBond eq true",

    select = 'DocumentTitle, RIC, ISIN, AssetTypeDescription, MaturityDate, FaceOutstandingUSD, TrancheAmount, CouponClass, Currency, IssueDate, SeniorityTypeDescription, MaturityCorpModDuration, MaturityCorpYield, Price, SectorDescription',

    top = 10000)

df

The screenshot of resulting dataframe is attached.

Please note that some of the fields (including names) might be different and to get all possible variables available for "FixedIncomeInstruments " searchview you can use the following query:

df = rdp.get_search_metadata(view = rdp.SearchViews.FixedIncomeInstruments)
df.to_excel('fixed.xlsx')

Then you can add the variable to the "select" field of the "rdp.search" code. This actually offers more flexibility than the Green Bond Guide.

This Article along with examples will be helpful if you want to have better in depth understanding of how RDP search API works.


Please let me know if you have any further questions

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.

Upvotes
399 4 5 9

see attached the resulting dataframe


greenbonds.png (106.2 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.

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.