For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
15 1 1 3

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!

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikondeals
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvote
Accepted
6.7k 8 6 7

@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.


1628508054386.png (26.7 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Thanks, I had to make a small alteration to the code for multiple 'SDC Deal Numbers'.

Within the if statement need to write;

data = data.append(df,ignore_index=True)
@appars apols have updated the answer now.
Click below to post an Idea Post Idea