This question is related to:
https://community.developers.refinitiv.com/questions/85452/python-to-download-debt-structure-with-issuer-and.html?childToView=101534#answer-101534
I cannot create a script that works when following https://developers.refinitiv.com/en/article-catalog/article/debt-structure-analysis-on-an-organizational-level
Can you please provide a full script that gets the list of company's debt by maturity, currency and cost of debt (kd) MRFG3.SA similar to what is shown in Debt Structure? Thank you.
Hi @dianne.palmario
You are correct. I was not testing against the GOV_CORP_INSTRUMENTS View.
As it turns out, it does not appear this specific View is keyed off of the RIC: MRFGT.SA. There may be an indirect route to derive a related RIC, but that would require a content expert to be involved to define that relationship. Regardless, there is some conversion that is required.
That being said, I was able to provide a 2-step way to get the data based on the RIC MRFGT.SA.
import refinitiv.data as rdfrom refinitiv.data.discovery import search_templates as st...ric = "MRFG3.SA"rd.discovery.search( view = rd.discovery.Views.GOV_CORP_INSTRUMENTS, filter = f"ParentOAPermID eq '{st.RICToIssuer.search(ric='MRFG3.SA').loc[0, 'IssuerOAPermID']}' and \ IsActive eq true and not(AssetStatus in ('MAT'))", select = "ISIN, MainSuperRIC, DBSTicker, IssueDate, Currency, RCSCurrencyLeaf, FaceIssuedTotal, \ EOMAmountOutstanding, NextCallDate, CouponRate, IsPerpetualSecurity, MaturityDate, \ CdsSeniorityEquivalentDescription")
@dianne.palmario So here is an API call using the latest Refinitiv Data (RD) Library:
import refinitiv.data as rd
rd.open_session()
rd.discovery.search( view = rd.discovery.Views.GOV_CORP_INSTRUMENTS, top=10000, filter = "ParentOAPermID eq '4295859830' and IsActive eq true and not(AssetStatus in ('MAT'))", select = "ISIN,MainSuperRIC,DBSTicker,IssueDate,Currency,RCSCurrencyLeaf,FaceIssuedTotal,EOMAmountOutstanding,NextCallDate,CouponRate,IsPerpetualSecurity,MaturityDate,CdsSeniorityEquivalentDescription")
This will produce a list of bonds satisfying the filter query.
Is this what you mean?
@jason.ramchandani01 - thank you.
Can you change the script where the input would be the RIC MRFG3.SA instead of the ParentOAPermID?
I just updated the Jupyter Notebook to work with the latest libraries and should work. Could you try again? You didn't provide any details what specifically did not work - it may have been a result of outdated code..
@nick.zincone The provided script above by @jason.ramchandani01 worked well on my end. However, what I need is a script where the input is the RIC MRFG3.SA and not the ParentOAPermID 4295859830
Please help and advise.
>> Can you change the script where the input would be the RIC MRFG3.SA instead of the ParentOAPermID?
You can try the following instead
filter = "PrimaryRIC xeq 'MRFG3.SA'"
Hello @nick.zincone - it is not returning result. Please check script.
rd.discovery.search(
view = rd.discovery.Views.GOV_CORP_INSTRUMENTS,
top=10000,
filter = "PrimaryRIC xeq 'MRFG3.SA' and IsActive eq true and not(AssetStatus in ('MAT'))",
select = "ISIN,MainSuperRIC,DBSTicker,IssueDate,Currency,RCSCurrencyLeaf,FaceIssuedTotal,EOMAmountOutstanding,NextCallDate,CouponRate,IsPerpetualSecurity,MaturityDate,CdsSeniorityEquivalentDescription"
)