I am looking forward to use the API on our python codes which we are using with Eikon. But seems ...

...like we are getting error. Can you please provide updated method inorder use it without any interruption.

I am looking forward to use the API on our python codes which we are using with Eikon. But seems like we are getting error. Can you please provide updated method inorder use it without any interruption.

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @chinthanah.m

    This is a duplicate question as Eikon to LSEG Workspace API post. My colleague already asked the client to enable the log file and share the log on the forum.

    Please also share the refinitiv-data.config.json too. That "Session is not opened. Can't send any request" error message might relate to the configuration file.

Answers

  • Hi @chinthanah.m ,


    Thank you for your question. Our latest library is LD Libraries for Python. You can access the quickstart and the documentation here.

    Additionally, this GitHub repo contains many examples of using the lib which you may also find useful.

    Finally, if you have any specific Eikon function that you want to convert and cannot find relevant examples in the resources above, please share the function here and we will be happy to suggest the equivalent in LD Libraries.


    Hope this helps.


    Best regards,

    Haykaz

  • Please find the code below:-

    CODE:-

    import refinitiv.data as rd

    from refinitiv.data.discovery import Screener

    from refinitiv.data.content import search

    from datetime import datetime, timedelta

    import pandas as pd

    from refinitiv.data.discovery import (

    convert_symbols,

    SymbolTypes

    )

    #deals_fields = ['TR.NIDealID','TR.NISdcPackageNumber','TR.NIMasterDealType.code',"TR.NIAllManagersRole(Concat='|').code","TR.NIManagersRole(Concat='|').code",'TR.NIIssueDate()','TR.NIIssuer','TR.NIIssuerPermId',"R.NIIssueType(Concat='|')",'TR.NITransactionStatus','TR.NIIssuerNation','TR.NICurrentFilingDate','TR.NIOfferPrice',"TR.NIProceedsAmtInclOverallotSoldAllMkts(Scale=6)","TR.NIIssuerExchTicker(Concat='|')",'TR.NISecurityTypeAllMkt',"TR.NIOfferingTechnique(Concat='|')","TR.NIGrossSpreadAsPctOfPrincipalAmtThisMktPrint","TR.NIIssuerDomicileSubRegion",'TR.NIIssuerDomicileRegion','TR.NIIssuerTRBCBusinessSector','TR.NIIssuerTRBCEcoSec',"TR.NILeadLeftBookrunner(Concat='|')","TR.NIBookOrCoManager(Concat='|')","TR.NIParentBookOrCoManager(IncludeNull=True,Concat='|')","TR.NIAllManagers(IncludeNull=True,Concat='|')","TR.NILeadManagers(IncludeNull=True,Concat='|')","TR.NIParentLeadManagers(IncludeNull=True,Concat='|')","TR.NIISINAtOffer(Concat='|')","TR.NIIssuerCusip9(Concat='|')","TR.NIIssuerSEDOL","TR.NIPrimaryTickerSymbol(IncludeNull=True,Concat='|')"]

    deals_fields = ['TR.NIDealID','TR.NISdcPackageNumber','TR.NIMasterDealType.code',"TR.NIAllManagersRole(Concat='|').code","TR.NIManagersRole(Concat='|').code",'TR.NIIssueDate()','TR.NIIssuer','TR.NIIssuerPermId',"R.NIIssueType(Concat='|')",'TR.NITransactionStatus','TR.NIIssuerNation','TR.NICurrentFilingDate','TR.NIOfferPrice',"TR.NIProceedsAmtInclOverallotSoldAllMkts(Scale=6)","TR.NIIssuerExchTicker(Concat='|')",'TR.NISecurityTypeAllMkt',"TR.NIOfferingTechnique(Concat='|')","TR.NIGrossSpreadAsPctOfPrincipalAmtThisMktPrint","TR.NIIssuerDomicileSubRegion",'TR.NIIssuerDomicileRegion','TR.NIIssuerTRBCBusinessSector','TR.NIIssuerTRBCEcoSec',"TR.NILeadLeftBookrunner(Concat='|')","TR.NIBookOrCoManager(Concat='|')","TR.NIParentBookOrCoManager(IncludeNull=True,Concat='|')","TR.NIAllManagers(IncludeNull=True,Concat='|')","TR.NILeadManagers(IncludeNull=True,Concat='|')","TR.NIParentLeadManagers(IncludeNull=True,Concat='|')","TR.NIISINAtOffer(Concat='|')","TR.NIIssuerCusip9(Concat='|')","TR.NIIssuerSEDOL","TR.NIIssuerPrimayTickerSymbol"]

    rd.open_session()

    current_date = datetime.strftime(today_date , '%Y%m%d')

    end_date = today_date - timedelta(days=8)

    end_date = datetime.strftime(end_date, '%Y%m%d')

    deals_screen = "SCREEN(U(IN(DEALS)/*UNV:DEALSBOND*/),TR.NIisECM=False, BETWEEN(TR.NIIssueDate(IncludeNull=True),{0},{1})/*dt:Date*/, CURN=USD)"

    deals_screen = deals_screen.format(current_date, end_date)

    today_date = datetime.strptime(current_date , '%Y%m%d') - timedelta(days=1)

    Error:-

    SCREEN(U(IN(DEALS)/*UNV:DEALSBOND*/),TR.NIisECM=False, BETWEEN(TR.NIIssueDate(IncludeNull=True),20241017,20241009)/*dt:Date*/, CURN=USD)

    [2024-10-18T15:25:32.464722+05:30] - [ERROR] - [sessions.desktop.workspace.2] - [12152] | MainThread

    Session is not opened. Can't send any request

    Traceback (most recent call last):

    Cell In[63], line 4

    lt = rd.get_data(deals_screen,deals_fields)

    File C:\JPMC\DEV\TMP\ds\tools\python3.10\latest\lib\site-packages\refinitiv\data\_fin_coder_layer\get_data_func.py:50 in get_data

    raise_if_closed(session)

    File C:\JPMC\DEV\TMP\ds\tools\python3.10\latest\lib\site-packages\refinitiv\data\_core\session\tools.py:38 in raise_if_closed

    raise ValueError(error_message)

    ValueError: Session is not opened. Can't send any request