IRPR data in Python

HannaCP
HannaCP LSEG
edited March 5 in Refinitiv Data Platform

Hi Team,

I am assisting a client to use the list of chains below and its data.

I sent him a sample code for 1 chain (USD)

import refinitiv.data as rd
session = rd.session.desktop.Definition(app_key=('DEFAULT_CODE_BOOK_APP_KEY')).get_session()
session.open()
rd.session.set_default(session)
IRPR_chain = rd.content.pricing.chain.Definition(name='0#USDIRPR').get_stream()
IRPR_chain.open(False)
print('0#USDIRPR constituents :', IRPR_chain.constituents)
irpr = rd.get_data(universe=IRPR_chain.constituents, fields=['IMPLD_RATE','IMPLD_BPS','MIR_IMP_RT','MAJ_IMP_RT','PRB_MIR_RT','PRB_MAJ_RT','IMP_RT_RT','EFF_DATE'])
print(irpr)

But he also needs it for the rest of the chains:
0#USDIRPR
0#AUDIRPR
0#BRLIRPR
0#CADIRPR
0#CLPIRPR
0#COPIRPR
0#CZKIRPR
0#EURIRPR
0#GBPIRPR
0#JPYIRPR
0#NZDIRPR
0#PLNIRPR
0#HUFIRPR
0#MXNIRPR
0#MXNIRPR2
0#SEKIRPR
0#CHFIRPR
0#RUBIRPR
0#INRIRPR
0#DKKIRPR
0#NOKIRPR
0#KRWIRPR

Is it possible to get all the data in one go with all these chains?

AS per client, he wants "to adjust the loop so that i create one dataframe with currencies as columns, impld_rate as vlaues, eff_date as index. eventually i'll resample to month so that I can get for every month the implied value. if two values for the same month, pick the last one."

Best Answer

  • Gurpreet
    Gurpreet admin
    Answer ✓

    Hello @HannaCP

    I don't think there is a way to request all this data in a single call without exceeding the data limits of the API. It is best to extract the data in a loop and have adequate wait-time in between the calls, to pace it out.

Answers

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.