question

Upvotes
Accepted
20 3 2 4

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 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
56.1k 145 45 65

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 512.0 KiB each and 1.0 MiB total.

Upvotes
56.1k 145 45 65

@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 512.0 KiB each and 1.0 MiB total.

I'm having a similar issue and I wanted to check the thread but it looks like it's no longer available.
Upvotes
20 3 2 4

Thank you.

It says Access Denied unfortunately.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
20 3 2 4

Fantastic - worked like a charm!


Thank you.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.