Pull deal specific data in Python using unique SDC Deal Number

I have downloaded a list of 1000 deals using the deal screener and now have access to each deals unique SDC deal number. I want to use the SDC deal number in python to access different data specific to that deal.

For example with the SDC Deal Number: 3635942040, using excel I am able to get the 'Deal Value' & Net Income 2 Years Prior using:

=@TR("SCREEN(U(IN(DEALS)/*UNV:DEALSMNA*/), Contains(TR.MNASDCDealNumber,""3635942040""), CURN=USD)","TR.MnADealValue(Curn=USD,Scale=6);TR.MnATargetNetIncome2Y"&"rPrior(Curn=USD,Scale=6)","CH=Fd").

I want to replicate this query in Python using the Eikon API so that I can loop through my list of SDC Deal Numbers and request any deal info I need.

Any help would be greatly appreciated. Thank you!

Best Answer

  • @appars Please try the following:

    deals = ['3635942040'] #add any more deals you have here or create a list #from dataframe column of rics or excel sheet column


    data = pd.DataFrame()
    for deal in deals:
        df,err = ek.get_data("SCREEN(U(IN(DEALS)/*UNV:DEALSMNA*/),IN(TR.MNASDCDealNumber,"+ deal +"))",['TR.MNASDCDealNumber','TR.MnADealValue(Curn=USD,Scale=6)','TR.MnATargetNetIncome2YrPrior(Curn=USD,Scale=6)'])
        if len(data):
            data.append(df,ignore_index=True)
        else: 
            data = df

    data

    1628508054386.png

    I hope this can help.

Answers