Eikon Python API - excel 'GRLS' function for annualized growth rate for share

Hi,

is there a way to retrieve the value for the excel api's GRLS function for a time span?

Many thanks,

Steffen

Best Answer

  • Alex Putkov.1
    Alex Putkov.1 ✭✭✭✭✭
    Answer ✓

    I assume you're asking about the equivalent to the following Excel formula that uses Datastream add-in

    =DSGRID("U:TRI","GRLS#(X,2Y)","Latest Value")
    If this is what you're looking to replicate in Python, then you need to use Datastream Web Service API.
    Here's an example Python code that implements the equivalent to the above request
    import PyDSWS
    import datetime as dt
    ds = PyDSWS.Datastream('your Datastream Child ID', 'your Datastream password')
    ds.get_data('U:TRI', ['GRLS#(X,2Y)'], date=dt.date.today())

Answers

  • Thanks Alex.

    When trying to connect to DSWS, I get the following error when executing line "ds = PyDSWS("....

    ConnectionError: HTTPConnectionPool(host='product.datastream.com', port=80): Max retries exceeded with url:

    /DSWSClient/V1/DSService.svc/rest/Token?username=***&password=***

    (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000000000C274C18>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))
  • Alex Putkov.1
    Alex Putkov.1 ✭✭✭✭✭

    @steffen.fuchs
    I think it's likely due to your Internet proxy. Try explicitly specifying the proxy as suggested on this thread discussing similar issue.

  • works. Thanks, Alex