Debt Structure using Python

This question is related to:
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.
Best Answer
-
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 rd
from 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"
)0
Answers
-
@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?
0 -
@jason.ramchandani01 - thank you.
Can you change the script where the input would be the RIC MRFG3.SA instead of the ParentOAPermID?
0 -
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..
0 -
@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.
0 -
>> 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'"
0 -
Hello @nick.zincone - it is not returning result. Please check script.
import refinitiv.data as rd
rd.open_session()
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"
)
0 -
Hi @dianne.palmario ,
How about this?
df = rd.discovery.search(
view = rd.discovery.Views.GOV_CORP_INSTRUMENTS,
top=10000,
query="MARFRIG GLOBAL",
filter = "MaturityDate ge 2023-01-01 and IsActive eq true", # can use "IsActive eq true and MaturityDate ge {datetime.now().strftime('%Y-%m-%d')}" wit `from datetime import datetime`
select = str("ParentPortRIC,RicRoot,ParentPortRIC,PrimaryRIC,RIC,IsActive,MainSuperRIC,DBSTicker,IssueDate,Currency,RCSCurrencyLeaf," +
"FaceIssuedTotal,EOMAmountOutstanding,NextCallDate,CouponRate," +
"IsPerpetualSecurity,MaturityDate,CdsSeniorityEquivalentDescription"))
df0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛