How do I use the Adfin Library in Python

Best Answer

  • sampleadcalibrateeikondesktopdataapipy.zipI presume you're asking about Adfin Analytics calculation library, right? There's no native Adfin Analytics package for Python, however you can use Adfin Analytics COM library in Python through win32com Python extension.
    1. Install win32com Python extension, which you can download from https://sourceforge.net/projects/pywin32/files/pywin32/

    2. Generate py files for each COM library you need to use by executing the following commands in Windows Command Prompt:

    • cd C:\Python33\Lib\site-packages\win32com\client
    • py makepy.py "C:\Program Files (x86)\Thomson Reuters\Eikon\EikonDesktopDataAPI.dll"
    • py makepy.py "C:\Program Files (x86)\Thomson Reuters\Eikon\X\Bin\adxfo.dll"

    3. Use attached sample script, which demonstrates a basic example of calling AdCalibrate method implemented in Adfin Analytics Functions COM library.

    Note that all Eikon COM APIs are 32-bit, hence you can only use them in 32-bit Python.

Answers

  • Instead of using sourceforge, you can also use on windows:

    py -3.10 -m pip install pywin32

    (if your version is not 3.10, change this number)