question

Upvotes
Accepted
5 1 2 2

Connecting using Python

Hello,


I have some problems using Datastream via python. I'm trying to connect to Datastream using the sample code with python code:

import DatastreamDSWS as DSWS
ds = DSWS.Datastream(username='NN', password='XX')
ds.get_data(tickers='VOD', fields='P', kind=0)

Using my correct username and password yields:


Exception: Invalid Token Value

_get_token : Exception Occured

(<class 'ModuleNotFoundError'>, ModuleNotFoundError("No module named 'wincertstore'"), <traceback object at 0x000002316A8F8248>)

None

get_data : Exception Occured

(<class 'Exception'>, Exception('Invalid Token Value'), <traceback object at 0x000002316A8B1848>)

None


The test web page http://product.datastream.com/DswsClient/Docs/TestSoapV1.aspx yields a valid results.


My python venv list is:

Python version is 3.7.6.


Does anyone know how I can this working?


Thank you for your help.

pythondatastream-apidsws-api
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.

Upvote
Accepted
38.1k 71 35 53

I am so sorry. That question is marked as private.

You may need to install the wincertstore package.

pip install wincertstore  

Anyway, the wincertstore package is available on Windows.

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.

Upvotes
38.1k 71 35 53

@aNadjalin

Please refer to the answers in this thread.


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.

Upvotes
5 1 2 2

Thank you.

It says Access Denied unfortunately.

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.

Upvotes
5 1 2 2

Fantastic - worked like a charm!


Thank you.

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.

Click below to post an Idea Post Idea