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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 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 5.0 MiB each and 10.0 MiB total.

Upvote
Accepted
6.7k 8 6 7

@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 5.0 MiB each and 10.0 MiB total.

Upvote
39 1 0 4

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 5.0 MiB each and 10.0 MiB total.

Upvotes
39 1 0 4

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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea