Skip to content

Commit f147394

Browse files
committed
Update Python dependencies and add requirements for Jupyter notebooks
1 parent 1004da3 commit f147394

File tree

6 files changed

+227
-125
lines changed

6 files changed

+227
-125
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Python/.ipynb_checkpoints
22
Python/.env
33
Python/jupyterlab_ESG_Screener_RDP_Search.ipynb
4+
Python/dotenvenv/
5+
Python/notebookenv/
46

57

68
Java/.idea

Java/src/main/java/com/refinitiv/ws/cloud/MarketPriceRdpGwServiceDiscovery.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//| This source code is provided under the Apache 2.0 license --
33
//| and is provided AS IS with no warranty or guarantee of fit for purpose. --
44
//| See the project's LICENSE.md for details. --
5-
//| Copyright (C) 2018-2021 Refinitiv. All rights reserved. --
5+
//| Copyright (C) 2018-2025 LSEG. All rights reserved. --
66
//|-----------------------------------------------------------------------------
77

88
package com.refinitiv.ws.cloud;
@@ -43,9 +43,9 @@
4343
import io.github.cdimascio.dotenv.Dotenv;
4444

4545
/*
46-
* This example demonstrates authenticating via Refinitiv Data Platform, using an
47-
* authentication token to discover Refinitiv Real-Time service endpoint, and
48-
* using the endpoint and authentitcation to retrieve market content.
46+
* This example demonstrates authenticating via Delivery Platform (RDP), using an
47+
* authentication token to discover the Real-Time service endpoint, and
48+
* using the endpoint and authentication to retrieve market content.
4949
*
5050
* This example maintains a session by proactively renewing the authentication
5151
* token before expiration.
@@ -56,16 +56,16 @@
5656
* each of the hosts.
5757
*
5858
* It performs the following steps:
59-
* - Authenticating via HTTP Post request to Refinitiv Data Platform
59+
* - Authenticating via HTTP Post request to Delivery Platform (RDP)
6060
* - Retrieving service endpoints from Service Discovery via HTTP Get request,
61-
* using the token retrieved from Refinitiv Data Platform
61+
* using the token retrieved from RDP
6262
* - Opening a WebSocket (or two, if the --hotstandby option is specified) to
63-
* a Refinitiv Real-Time Service endpoint, as retrieved from Service Discovery
63+
* a Real-Time Service endpoint, as retrieved from Service Discovery
6464
* - Sending Login into the Real-Time Service using the token retrieved
65-
* from Refinitiv Data Platform.
65+
* from RDP.
6666
* - Requesting market-price content.
6767
* - Printing the response content.
68-
* - Periodically proactively re-authenticating to Refinitiv Data Platform, and
68+
* - Periodically proactively re-authenticating to RDP, and
6969
* providing the updated token to the Real-Time endpoint before token expiration.
7070
*/
7171

@@ -458,7 +458,7 @@ public static void main(String[] args) {
458458
}
459459
try {
460460

461-
// Connect to Refinitiv Data Platform and authenticate (using our username and password)
461+
// Connect to RDP and authenticate (using our username and password)
462462
authJson = getAuthenticationInfo(null);
463463
if (authJson == null)
464464
System.exit(1);
@@ -536,7 +536,7 @@ else if(region.equals("apac"))
536536
// Continue using current token until 90% of initial time before it expires.
537537
Thread.sleep(expireTime * 900); // The value 900 means 90% of expireTime in milliseconds
538538

539-
// Connect to Refinitiv Data Platform and re-authenticate, using the refresh token provided in the previous response
539+
// Connect to RDP and re-authenticate, using the refresh token provided in the previous response
540540
authJson = getAuthenticationInfo(authJson);
541541
if (authJson == null)
542542
System.exit(1);
@@ -697,7 +697,7 @@ public static boolean changePassword(String authServer) {
697697

698698

699699
/**
700-
* Authenticate to Refinitiv Data Platform via an HTTP post request.
700+
* Authenticate to RDP via an HTTP post request.
701701
* Initially authenticates using the specified password. If information from a previous authentication response is provided, it instead authenticates using
702702
* the refresh token from that response. Uses authUrl as url.
703703
* @param previousAuthResponseJson Information from a previous authentication, if available
@@ -709,7 +709,7 @@ public static JSONObject getAuthenticationInfo(JSONObject previousAuthResponseJs
709709
}
710710

711711
/**
712-
* Authenticate to Refinitiv Data Platform via an HTTP post request.
712+
* Authenticate to RDP via an HTTP post request.
713713
* Initially authenticates using the specified password. If information from a previous authentication response is provided, it instead authenticates using
714714
* the refresh token from that response.
715715
* @param previousAuthResponseJson Information from a previous authentication, if available
@@ -763,15 +763,15 @@ public static JSONObject getAuthenticationInfo(JSONObject previousAuthResponseJs
763763
case HttpStatus.SC_OK: // 200
764764
// Authentication was successful. Deserialize the response and return it.
765765
JSONObject responseJson = new JSONObject(EntityUtils.toString(response.getEntity()));
766-
System.out.println("Refinitiv Data Platform Authentication succeeded. RECEIVED:");
766+
System.out.println("RDP Authentication succeeded. RECEIVED:");
767767
System.out.println(responseJson.toString(2));
768768
return responseJson;
769769
case HttpStatus.SC_MOVED_PERMANENTLY: // 301
770770
case HttpStatus.SC_MOVED_TEMPORARILY: // 302
771771
case HttpStatus.SC_TEMPORARY_REDIRECT: // 307
772772
case 308: // 308 HttpStatus.SC_PERMANENT_REDIRECT
773773
// Perform URL redirect
774-
System.out.println("Refinitiv Data Platform authentication HTTP code: " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
774+
System.out.println("RDP authentication HTTP code: " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
775775
Header header = response.getFirstHeader("Location");
776776
if( header != null )
777777
{
@@ -786,7 +786,7 @@ public static JSONObject getAuthenticationInfo(JSONObject previousAuthResponseJs
786786
case HttpStatus.SC_BAD_REQUEST: // 400
787787
case HttpStatus.SC_UNAUTHORIZED: // 401
788788
// Retry with username and password
789-
System.out.println("Refinitiv Data Platform authentication HTTP code: " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
789+
System.out.println("RDP authentication HTTP code: " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
790790
if (previousAuthResponseJson != null)
791791
{
792792
System.out.println("Retry with username and password");
@@ -796,17 +796,17 @@ public static JSONObject getAuthenticationInfo(JSONObject previousAuthResponseJs
796796
case HttpStatus.SC_FORBIDDEN: // 403
797797
case 451: // 451 Unavailable For Legal Reasons
798798
// Stop retrying with the request
799-
System.out.println("Refinitiv Data Platform authentication HTTP code: " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
799+
System.out.println("RDP authentication HTTP code: " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
800800
System.out.println("Stop retrying with the request");
801801
return null;
802802
default:
803-
// Retry the request to Refinitiv Data Platform
804-
System.out.println("Refinitiv Data Platform authentication HTTP code: " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
805-
System.out.println("Retry the request to Refinitiv Data Platform");
803+
// Retry the request to RDP
804+
System.out.println("RDP authentication HTTP code: " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
805+
System.out.println("Retry the request to RDP");
806806
return getAuthenticationInfo(previousAuthResponseJson);
807807
}
808808
} catch (Exception e) {
809-
System.out.println("Refinitiv Data Platform authentication failure:");
809+
System.out.println("RDP authentication failure:");
810810
e.printStackTrace();
811811
return null;
812812
}
@@ -855,7 +855,7 @@ public static JSONObject queryServiceDiscovery( String url ) {
855855
case HttpStatus.SC_OK: // 200
856856
// Service discovery was successful. Deserialize the response and return it.
857857
JSONObject responseJson = new JSONObject(EntityUtils.toString(response.getEntity()));
858-
System.out.println("Refinitiv Data Platform service discovery succeeded. RECEIVED:");
858+
System.out.println("RDP service discovery succeeded. RECEIVED:");
859859
System.out.println(responseJson.toString(2));
860860
return responseJson;
861861
case HttpStatus.SC_MOVED_PERMANENTLY: // 301
@@ -864,7 +864,7 @@ public static JSONObject queryServiceDiscovery( String url ) {
864864
case HttpStatus.SC_TEMPORARY_REDIRECT: // 307
865865
case 308: // 308 HttpStatus.SC_PERMANENT_REDIRECT
866866
// Perform URL redirect
867-
System.out.println("Refinitiv Data Platform service discovery HTTP code: " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
867+
System.out.println("RDP service discovery HTTP code: " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
868868
Header header = response.getFirstHeader("Location");
869869
if( header != null )
870870
{
@@ -879,17 +879,17 @@ public static JSONObject queryServiceDiscovery( String url ) {
879879
case HttpStatus.SC_FORBIDDEN: // 403
880880
case 451: // 451 Unavailable For Legal Reasons
881881
// Stop retrying with the request
882-
System.out.println(" Refinitiv Data Platform service discovery HTTP code: " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
882+
System.out.println("RDP service discovery HTTP code: " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
883883
System.out.println("Stop retrying with the request");
884884
return null;
885885
default:
886886
// Retry the service discovery request
887-
System.out.println("Refinitiv Data Platform service discovery HTTP code: " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
887+
System.out.println("RDP service discovery HTTP code: " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
888888
System.out.println("Retry the service discovery request");
889889
return queryServiceDiscovery();
890890
}
891891
} catch (Exception e) {
892-
System.out.println("Refinitiv Data Platform service discovery failure:");
892+
System.out.println("RDP service discovery failure:");
893893
e.printStackTrace();
894894
return null;
895895
}

Python/rdp_apis_notebook.ipynb

Lines changed: 17 additions & 16 deletions
Large diffs are not rendered by default.

Python/requirements-notebook.txt

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
anyio==4.8.0
2+
argon2-cffi==23.1.0
3+
argon2-cffi-bindings==21.2.0
4+
arrow==1.3.0
5+
asttokens==3.0.0
6+
async-lru==2.0.4
7+
attrs==25.1.0
8+
babel==2.16.0
9+
beautifulsoup4==4.12.3
10+
bleach==6.2.0
11+
certifi==2024.12.14
12+
cffi==1.17.1
13+
charset-normalizer==3.4.1
14+
colorama==0.4.6
15+
comm==0.2.2
16+
contourpy==1.3.1
17+
cycler==0.12.1
18+
debugpy==1.8.12
19+
decorator==5.1.1
20+
defusedxml==0.7.1
21+
exceptiongroup==1.2.2
22+
executing==2.2.0
23+
fastjsonschema==2.21.1
24+
fonttools==4.55.8
25+
fqdn==1.5.1
26+
h11==0.14.0
27+
httpcore==1.0.7
28+
httpx==0.28.1
29+
idna==3.10
30+
ipykernel==6.29.5
31+
ipython==8.31.0
32+
isoduration==20.11.0
33+
jedi==0.19.2
34+
Jinja2==3.1.5
35+
json5==0.10.0
36+
jsonpointer==3.0.0
37+
jsonschema==4.23.0
38+
jsonschema-specifications==2024.10.1
39+
jupyter-events==0.11.0
40+
jupyter-lsp==2.2.5
41+
jupyter_client==8.6.3
42+
jupyter_core==5.7.2
43+
jupyter_server==2.15.0
44+
jupyter_server_terminals==0.5.3
45+
jupyterlab==4.3.5
46+
jupyterlab_pygments==0.3.0
47+
jupyterlab_server==2.27.3
48+
kiwisolver==1.4.8
49+
MarkupSafe==3.0.2
50+
matplotlib==3.10.0
51+
matplotlib-inline==0.1.7
52+
mistune==3.1.1
53+
nbclient==0.10.2
54+
nbconvert==7.16.6
55+
nbformat==5.10.4
56+
nest-asyncio==1.6.0
57+
notebook_shim==0.2.4
58+
numpy==2.2.2
59+
overrides==7.7.0
60+
packaging==24.2
61+
pandas==2.2.3
62+
pandocfilters==1.5.1
63+
parso==0.8.4
64+
pillow==11.1.0
65+
platformdirs==4.3.6
66+
prometheus_client==0.21.1
67+
prompt_toolkit==3.0.50
68+
psutil==6.1.1
69+
pure_eval==0.2.3
70+
pycparser==2.22
71+
Pygments==2.19.1
72+
pyparsing==3.2.1
73+
python-dateutil==2.9.0.post0
74+
python-dotenv==1.0.1
75+
python-json-logger==3.2.1
76+
pytz==2024.2
77+
pywin32==308
78+
pywinpty==2.0.14
79+
PyYAML==6.0.2
80+
pyzmq==26.2.0
81+
referencing==0.36.2
82+
requests==2.32.3
83+
rfc3339-validator==0.1.4
84+
rfc3986-validator==0.1.1
85+
rpds-py==0.22.3
86+
Send2Trash==1.8.3
87+
six==1.17.0
88+
sniffio==1.3.1
89+
soupsieve==2.6
90+
stack-data==0.6.3
91+
terminado==0.18.1
92+
tinycss2==1.4.0
93+
tomli==2.2.1
94+
tornado==6.4.2
95+
traitlets==5.14.3
96+
types-python-dateutil==2.9.0.20241206
97+
typing_extensions==4.12.2
98+
tzdata==2025.1
99+
uri-template==1.3.0
100+
urllib3==2.3.0
101+
wcwidth==0.2.13
102+
webcolors==24.11.1
103+
webencodings==0.5.1
104+
websocket-client==1.8.0

Python/requirements.txt

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
asttokens==2.0.5
2-
certifi==2024.7.4
3-
charset-normalizer==2.0.3
4-
colorama==0.4.4
5-
cycler==0.10.0
6-
executing==0.7.0
7-
idna==3.7
8-
kiwisolver==1.3.1
9-
matplotlib==3.4.2
10-
numpy==1.22.0
11-
pandas==1.3.1
12-
Pillow==10.3.0
13-
Pygments==2.15.0
14-
pyparsing==2.4.7
15-
python-dateutil==2.8.2
16-
python-dotenv==0.19.0
17-
pytz==2021.1
18-
requests==2.32.2
19-
six==1.16.0
20-
urllib3==1.26.19
21-
wincertstore==0.2
1+
certifi==2024.12.14
2+
charset-normalizer==3.4.1
3+
contourpy==1.3.1
4+
cycler==0.12.1
5+
fonttools==4.55.8
6+
idna==3.10
7+
kiwisolver==1.4.8
8+
matplotlib==3.10.0
9+
numpy==2.2.2
10+
packaging==24.2
11+
pandas==2.2.3
12+
pillow==11.1.0
13+
pyparsing==3.2.1
14+
python-dateutil==2.9.0.post0
15+
python-dotenv==1.0.1
16+
pytz==2024.2
17+
requests==2.32.3
18+
six==1.17.0
19+
tzdata==2025.1
20+
urllib3==2.3.0

0 commit comments

Comments
 (0)