DSS Python Shareholder Rights Example Application

I downloaded below sample file.

https://developers.refinitiv.com/en/api-catalog/datascope-select/datascope-select-rest-api/download

Python Shareholder Rights Example Application

Updated on 5 Jan 2018.

dss-python-shareholder-r...mple.zip

562.98KB • 11 Sep 2020


When I run on VSC, it returns below error mgs under line 308.

Can you advise me what needs to be modified?

--------------------------------------------------------------------------------------------------------

PS C:\Temp\DSS\dss-python-shareholder-rights-sample> python fetchDSSshareHolderData.py

currDTstr=20210209164026

INFO, 20210209164026, Start time

INFO, 20210209164027, Successfully created token (STEP 1)

ERROR, 20210209164026, GET InstrumentListGetByName failed with 404

Traceback (most recent call last):

File "C:\Temp\DSS\dss-python-shareholder-rights-sample\fetchDSSshareHolderData.py", line 545, in <module>

main(sys.argv[1:])

File "C:\Temp\DSS\dss-python-shareholder-rights-sample\fetchDSSshareHolderData.py", line 478, in main

listId = getListId(headers2)

File "C:\Temp\DSS\dss-python-shareholder-rights-sample\fetchDSSshareHolderData.py", line 308, in getListId

print ('ERROR, ' + datetime.datetime.strftime(datetime.datetime.now(), "%Y%m%d%H%M%S") + ',' + k)

TypeError: can only concatenate str (not "dict") to str


--------------------------------------------------------------------------------------------------------

Best Answer

  • Gurpreet
    Gurpreet admin
    Answer ✓

    Here is the response before/after importing the Entity and Instrument lists.

    currDTstr=20210209092921
    INFO, 20210209092921, Start time
    INFO, 20210209092922, Successfully created token (STEP 1)
    ERROR, 20210209092921, GET InstrumentListGetByName failed with 404
    Traceback (most recent call last):
      File "fetchDSSshareHolderData.py", line 545, in <module>
        main(sys.argv[1:])
      File "fetchDSSshareHolderData.py", line 478, in main
        listId = getListId(headers2)
      File "fetchDSSshareHolderData.py", line 308, in getListId
        print ('ERROR, ' + datetime.datetime.strftime(datetime.datetime.now(), "%Y%m%d%H%M%S") + ',' + k)
    TypeError: can only concatenate str (not "dict") to str

    After:

    currDTstr=20210209094605
    INFO, 20210209094605, Start time
    INFO, 20210209094606, Successfully created token (STEP 1)
    INFO, 20210209094607, Fetched Instrument ListId for API_ShareHolder_Disclosure_InstrumentList sucessfully where ListId = 0x076fa6a1e0573d01 and Count = 26 (STEP 2)
    INFO, 20210209094607, Fetched Entity ListId for API_ShareHolder_Disclosure_EntityList sucessfully where ListId = 0x076fa9ec1aa73d0e and Count = 24029 (STEP 3)
    INFO, 20210209094608, Number of Report Templates is 4 (STEP 4)
    INFO, 20210209094608, Current Report Template name = Demo_TicksTrades_Template (0x05f1623b11ab2f86) of type = THT (STEP5)
    INFO, 20210209094608, Current Report Template name = IDReport (0x05af5bcd275b2f96) of type = IDP (STEP 5)
    INFO, 20210209094608, Current Report Template name = export-xml.suffix.5D99E77C (0x05fa6722184b2f76) of type = EOD (STEP 5)
    INFO, 20210209094608, Current Report Template name = export-xml.suffix.718D8638 (0x05fa66ee489b2f96) of type = EOD (STEP 5)
    INFO, 20210209094608, End time


Answers