Python command discovery.convert_symbols fails for matured bonds

IoannisG
IoannisG Newcomer

In Codebook, the Python commands:

import refinitiv.data as dl

dl.open_session()

ISINs=['DE000A11QTD2']

RICs=dl.discovery.convert_symbols(ISINs).loc[:,'RIC']

produce an error when an ISIN of an expired bond (e.g. DE000A11QTD2) is specified. However, it works for not expired bonds.

What can be done so that the command works with expired and non-expired bonds at the same time?

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @IoannisG

    I found that you can use the get_data method to get RICs from ISINs.

    df = rd.get_data(
        universe = ['DE000A11QTD2','FR001400HX73','XS1028941117'],
        fields = ['TR.RIC'])
    
    df
    
    image.png

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @IoannisG

    Thank you for reaching out to us.

    You can try the Search API.

    df = rd.discovery.search(
        view = rd.discovery.Views.SEARCH_ALL,
        filter = "IssueISIN eq 'DE000A11QTD2'",
        select = "DocumentTitle,IssueISIN,RIC",
        top = 100)
    df
    

    It returns:

    image.png

    The search example is also available on GitHub.

  • IoannisG
    IoannisG Newcomer

    OK, thanks. How do I make the discovery.Views.SEARCH_ALL command work with more than 1 ISIN, and also that the command returns just one RIC for each ISIN? E.g. the previous command

    ISINs=['FR001400HX73','XS1028941117']

    RICs=dl.discovery.convert_symbols(ISINs).loc[:,'RIC']

    RICs

    works for 2 ISINs and returns just 1 RIC for each ISIN.