Cannot connect anymore to DSWS through Python
Hello,
I've been using DSWS for a while on the same environment, but since last week I can no longer use it. Let me copy/paste what I get:
import DatastreamDSWS as DSWS
ds = DSWS.Datastream(username='...',password='...')
HTTPSConnectionPool(host='product.datastream.com', port=443): Read timed out. (read timeout=180)
_get_json_Response : Exception Occured:
HTTPSConnectionPool(host='product.datastream.com', port=443): Read timed out. (read timeout=180)
For your information here are some details on that environment:
Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
IPython 6.5.0 -- An enhanced Interactive Python.
Would you have any idea regarding this issue ?
Thanks.
Best Answer
-
You can use the requests Python library to check network settings. Please try the following code in the same environment.
import requests
url = 'https://product.datastream.com/DSWSClient/V1/DSService.svc/rest/GetToken';
myobj = {"Password": "<username>",
"Properties": [{"Key": "__AppId", "Value": "PythonLib-1.1.0"}],
"UserName": "<password>"}
x = requests.post(url, json = myobj)
print(x.status_code)
print(x.text)You may need to enable HTTP logging in Python.
import logging
import http.client
http.client.HTTPConnection.debuglevel = 1
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
requests_log = logging.getLogger("requests.packages.urllib3")
requests_log.setLevel(logging.DEBUG)
requests_log.propagate = True1
Answers
-
Hello @mathieu.duarte
What is the version of DatastreamDSWS in your environment?
You can check the version from the following command:
pip show DatastreamDSWS
The latest version of the API is version 1.0.10 (as of Apr 2022), if you are using a lower version, please try to update the library.
0 -
Hi @wasin.w ,
I'm already using 1.0.10 so I guess the problem does not come from this.
0 -
Hello @mathieu.duarte
Thank you for the information. I can connect to DSWS using DatastreamDSWS 1.0.10.
Are there any changes in your network?
Please test with the http://product.datastream.com/DswsClient/Docs/TestRestV1.aspx page.
First, use the Get Token method to get a token.
Then, use the token with the Data (HTTP GET) method to get the data. Next, check the response.
1 -
@wasin.w ,
I tested with your page and following the "Get Token" method I managed to obtain an example of result with both "Get Data" and the "Data (HTTP GET)"
0 -
Hi @Jirapongse ,
Following the command "x = requests.post(url,json=myobj)" the station remains frozen with just: "DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): product.datastream.com:443"
Nothing else happens.
Would you know what I should do next ?
0 -
Hello @mathieu.duarte
I have tested the steps suggested by @Jirapongse.The result is shown below.
According to your statement, it may be a network issue between your Python environment and Datastream. I highly recommend you contact your local IT support to verify the network setting in your environment.
0 -
Thanks for your answers. Following some interaction with my local IT support we've adjusted some proxy parameters and it solved this problem.
1
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛