How can I import a shareholder history report through the eikon python API?

I would like to import a shareholder history report for a company as a pandas dataframe, i.e. at least the absolute amount of capital invested and the changes therein. Preferably though I would like to get the complete shareholder history report in the same structure as you can simply download it in excel. I have not been able to find the respective code for that in the instrument browser. If someone would be able to provide a coding example, that would be very helpful! Thanks in advance

Best Answer

  • @henry.hildebrandt

    So, this will give you the current snapshot:

    df, e = tr.get_data('TRI.N', ['TR.SharesHeld.InvestorPermID', 'TR.SharesHeld.Value'], {'SDate':'0D'})

    This - last calendar year end:

    df, e = tr.get_data('TRI.N', ['TR.SharesHeld.InvestorPermID', 'TR.SharesHeld.Value'], {'SDate':'0CY'})

    You can issue a second request to look up which perm id represents which company:

    codes = df['Investor Perm Id'].apply(lambda x: f'{x:.0f}').tolist()
    cmp, e = tr.get_data(codes, ['TR.CommonName'])

    image

Answers

  • You can also use a TR.InvestorFullName field to get the full name of the investor.

    df, e = ek.get_data('TRI.N', ['TR.InvestorFullName', 'TR.SharesHeld'], {'SDate':'0D'})