Skip to content

Commit 95caeb2

Browse files
committed
Merge branch 'update_rkd_endpoint'
1. Update RKD API rebrand information 2. Update API endpoint from api.trkd.thomsonreuters.com to api.rkd.refinitiv.com 3. Update API endpoint from streaming.trkd.thomsonreuters.com to streaming.rkd.refinitiv.com 4. Fix all typo errors
2 parents 4448bd1 + 2ecd490 commit 95caeb2

16 files changed

+1125
-1043
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ interday_result4.txt
1212
notebook/test/
1313
notebook/.ipynb_checkpoints
1414
*/.ipynb_checkpoints/*
15-
trkd_websocketexample.py
15+
trkd_websocketexample.py
16+
ERT_in_Cloud/
17+
docs_tr/

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2018 Refinitiv
1+
Copyright 2020 Refinitiv
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

README.md

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
1-
# TRKD HTTP JSON with Python Example
1+
# RKD HTTP JSON with Python Example
22
## Overview
3-
The [Refnitiv Knowledge Direct (TRKD) API](https://developers.refinitiv.com/thomson-reuters-knowledge-direct-trkd) integrates into your website, trading platform, company intranet/extranet, advisory portal and mobile applications to provide up-to-date financial market data, news and analytics and powerful investment tools.
3+
The [Refinitiv Knowledge Direct (RKD) API](https://developers.refinitiv.com/thomson-reuters-knowledge-direct-trkd) (formerly known as TRKD API) integrates into your website, trading platform, company intranet/extranet, advisory portal and mobile applications to provide up-to-date financial market data, news and analytics and powerful investment tools.
44

5-
TRKD offers a wide range of Refinitiv' information and services delivered in a request-response scenario via web services using today's industry standard protocols (SOAP/XML and REST/JSON). Connectivity can be via HTTP and HTTPS, over the Internet or Delivery Direct. All data are snapshot (non-streaming) data.
5+
RKD offers a wide range of Refinitiv' information and services delivered in a request-response scenario via web services using today's industry standard protocols (SOAP/XML and REST/JSON). Connectivity can be via HTTP and HTTPS, over the Internet or Delivery Direct. All data are snapshot (non-streaming) data.
66

7-
This is an example project that shows how to implement TRKD HTTP JSON client and TRKD Streaming client with Python programming lanugage. The project example are in both console and Jupyter Notebook applications.
7+
This is an example project that shows how to implement RKD HTTP JSON client and RKD Streaming client with Python programming language. The project example are in both console and Jupyter Notebook applications.
88

9-
*Note:* The Jupyter Notebook example does not contain all the same TRKD services service as console examples yet. [TBD]
9+
*Note:* The Jupyter Notebook example does not contain all the same RKD services service as console examples yet. [TBD]
1010

1111
## Application Files
12-
This project contains the following example scripts for each TRKD services
13-
- trkd_authen.py: An example application that shows how to authenticate with TRKD service
14-
- trkd_quote.py: An example application that shows how to subscribe (all fields and specific fields) the Quote data from TRKD service
15-
- trkd_newsheadline.py: An example application that shows how to subscribe the News Headline data from TRKD service
16-
- trkd_newsstory.py: An example application that shows how to subscribe the News Story data from TRKD service
17-
- trkd_intraday.py: An example application that shows how to subscribe the Intraday Time-series data from TRKD service
18-
- trkd_interday.py: An example application that shows how to subscribe the Interday Time-series data from TRKD service
19-
- trkd_onlinereport.py: An example application that shows how to subscribe the Online Report data from TRKD service
20-
- trkd_chart.py: An example application that shows how to subscribe and download the Chart image data from TRKD service
21-
- trkd_wsstreaming.py: An example application that show how to subscribe the Quote data from TRKD Streming service via a WebSocket connection
12+
This project contains the following example scripts for each RKD services
13+
- trkd_authen.py: An example application that shows how to authenticate with RKD service
14+
- trkd_quote.py: An example application that shows how to subscribe (all fields and specific fields) the Quote data from RKD service
15+
- trkd_newsheadline.py: An example application that shows how to subscribe the News Headline data from RKD service
16+
- trkd_newsstory.py: An example application that shows how to subscribe the News Story data from RKD service
17+
- trkd_intraday.py: An example application that shows how to subscribe the Intraday Time-series data from RKD service
18+
- trkd_interday.py: An example application that shows how to subscribe the Interday Time-series data from RKD service
19+
- trkd_onlinereport.py: An example application that shows how to subscribe the Online Report data from RKD service
20+
- trkd_chart.py: An example application that shows how to subscribe and download the Chart image data from RKD service
21+
- trkd_wsstreaming.py: An example application that show how to subscribe the Quote data from RKD Streaming service via a WebSocket connection
2222
- notebook folder:
23-
- *notebook/trkd_authentication.ipynb*: A Jupyter Notebook TRKD Authentication service example
24-
- *notebook/trkd_timeseries_interday.ipynb*: A Jupyter Notebook TRKD Time-Series Interday service example
25-
- *notebook/trkd_timeseries_intraday.ipynb*: A Jupyter Notebook TRKD Time-Series Intraday service example
23+
- *notebook/trkd_authentication.ipynb*: A Jupyter Notebook RKD Authentication service example
24+
- *notebook/trkd_timeseries_interday.ipynb*: A Jupyter Notebook RKD Time-Series Interday service example
25+
- *notebook/trkd_timeseries_intraday.ipynb*: A Jupyter Notebook RKD Time-Series Intraday service example
2626
- requestments.txt: A requirement file contains a list of required libraries for HTTP JSON and WebSocket connections.
27-
- docs\TRKD_REST_with_Python.docx: A document that describes the trkd_authen.py and trkd_quote.py applications
2827

29-
All source code and scripts are provided under the Apache 2.0 license. Thye are provided AS IS with no warranty or guarantee of fit for purpose. See the project's LICENSE.md for details.
28+
All source code and scripts are provided under the Apache 2.0 license. They are provided AS IS with no warranty or guarantee of fit for purpose. See the project's LICENSE.md for details.
3029

3130
## Prerequisite
3231
The following softwares are required to use this script
33-
- TRKD API credentials. Please reach out to your Refinitiv sales associate to acquire TRKD access credentials.
34-
- Python 3
32+
- RKD API credentials. Please reach out to your Refinitiv sales associate to acquire RKD access credentials.
33+
- [Python 3](https://www.python.org/).
3534
- The [requests](http://docs.python-requests.org/en/master/) library
3635
- The [websocket-client](https://pypi.org/project/websocket-client/) library (*version 0.49 or greater*, for trkd_wsstreaming.py application only)
3736
- The [python-dateutil](https://pypi.org/project/python-dateutil/) library (for trkd_wsstreaming.py application only)
3837
- The [classic Jupyter Notebook](https://jupyter.org/) runtime (for the Notebook example application)
3938

40-
All scripts support Python 3 and not compatible with Python 2.
39+
All scripts support Python 3 only and not compatible with Python 2.
4140

4241
*Note:*
4342
- You can install Jupyter Notebook on your local machine and then test the example on the machine. The alternate choice is a free Jupyter Notebook on cloud environment such as [Azure Notebook](https://notebooks.azure.com/) provided by Microsoft. You can find more details from [this tutorial](https://docs.microsoft.com/en-us/azure/notebooks/tutorial-create-run-jupyter-notebook). If you are not familiar with Jupyter Notebook, the following [tutorial](https://www.datacamp.com/community/tutorials/tutorial-jupyter-notebook) created by DataCamp may help.
@@ -53,15 +52,15 @@ The best way is via the pip package management tool
5352
1. export <Python_folder>\Scripts to your OS PATH environment
5453
2. call pip command to install requests
5554
```
56-
$>pip install -r requestments.txt
55+
$>pip install -r requirements.txt
5756
```
5857
3. If you are behind proxy, set the proxy first
5958
```
6059
export https_proxy="http://<proxy.server>:<port>"
61-
$>pip install -r requestments.txt
60+
$>pip install -r requirements.txt
6261
```
6362

64-
*Note*: If you aim to use only TRKD HTTP JSON services, you can just install requests library via a ```pip install requests``` command.
63+
*Note*: If you aim to use only RKD HTTP JSON services, you can just install requests library via a ```pip install requests``` command.
6564

6665
## Optional - How to install libraries for notebook examples
6766
Please follow the [classic Jupyter Notebook installation guide](https://jupyter.org/install) page.
@@ -76,13 +75,10 @@ You may consider the strategic [Refinitiv Data Platform (RDP)](https://developer
7675

7776
Please see [RDP API Overview page](https://developers.refinitiv.com/refinitiv-data-platform/refinitiv-data-platform-apis) for more detail.
7877

79-
As part of RDP, [Elektron Real Time in Cloud (ERT in Cloud)](https://developers.thomsonreuters.com/elektron/websocket-api/quick-start?content=45253&type=quick_start) gives you access to best in class Real Time market data delivered in the cloud. ERT in Cloud is a new delivery mechanism for RDP, using the AWS (Amazon Web Services) cloud. Once a connection to RDP is established using ERT in Cloud, data can be retrieved using [Elektron WebSocket API](https://developers.thomsonreuters.com/websocket-api) (the same as TRKD Streaming Service).
78+
As part of RDP, [Elektron Real Time in Cloud (ERT in Cloud)](https://developers.thomsonreuters.com/elektron/websocket-api/quick-start?content=45253&type=quick_start) gives you access to best in class Real Time market data delivered in the cloud. ERT in Cloud is a new delivery mechanism for RDP, using the AWS (Amazon Web Services) cloud. Once a connection to RDP is established using ERT in Cloud, data can be retrieved using [Elektron WebSocket API](https://developers.thomsonreuters.com/websocket-api) (the same as RKD Streaming Service).
8079

8180
Key benefit of the strategic RDP and ERT in Cloud platform are the Cloud Delivery. The Platform is based on [Amazon AWS](https://aws.amazon.com/), the world class leading Cloud Provider for developers. The RDP and ERT in Cloud support output for multiple cloud vendors such as AWS, Azure, GCS, etc. for cloud-native or on-premise integration. The ERT in Cloud servers are hosted in multiple location world-wide which lets the application choose the closest server based on their region for full potential.
8281

83-
Please refer to [Elektron WebSocket API Quick Start - Connecting to Elektron Real Time in Cloud](https://developers.refinitiv.com/elektron/websocket-api/quick-start?content=45253&type=quick_start) page and [How to migrate the WebSocket application from TRKD Streaming service to Elektron Real Time in Cloud](https://developers.refinitiv.com/article/how-migrate-websocket-application-trkd-streaming-service-elektron-real-time-cloud) article for more detail.
84-
85-
8682
## References
8783
For further details, please check out the following resources:
8884
* [Refinitiv Knowledge Direct API page](https://developers.refinitiv.com/thomson-reuters-knowledge-direct-trkd) on the [Refinitiv Developers Community](https://developers.refinitiv.com/) web site.
@@ -109,9 +105,9 @@ For further details, please check out the following resources:
109105
- docs\TRKD_REST_with_Python.docx.
110106
- revise some code.
111107
- version 1.0.5: 27 Apr 2017
112-
- revies README.md to support markdown.
108+
- revise README.md to support markdown.
113109
- version 1.0.6: 3 May 2017
114-
- revies README.md.
110+
- revise README.md.
115111
- modify trkd_authen.py.
116112
- modify trkd_quote.py.
117113
- version 1.0.7: 9 May 2017
@@ -139,3 +135,6 @@ For further details, please check out the following resources:
139135
- Update TRKD Interday and Intraday services operations.
140136
- version 1.5.3: May 2020
141137
- Update RDP and ERT in Cloud information.
138+
- version 1.5.4: June 2020
139+
- Update API name and information.
140+
- Fix all typo errors

docs/TRKD_REST_with_Python.docx

-559 KB
Binary file not shown.

notebook/trkd_authentication.ipynb

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# TRKD HTTP JSON with Python Example: Authentication\n",
7+
"# RKD HTTP JSON with Python Example: Authentication\n",
88
"\n",
99
"## Overview\n",
10-
"The [Thomson Reuters Knowledge Direct (TRKD) API](https://developers.thomsonreuters.com/thomson-reuters-knowledge-direct-trkd) integrates into your website, trading platform, company intranet/extranet, advisory portal and mobile applications to provide up-to-date financial market data, news and analytics and powerful investment tools.\n",
10+
"The [Refinitiv Knowledge Direct (RKD) API](https://developers.refinitiv.com/thomson-reuters-knowledge-direct-trkd) (formerly known as TRKD API)integrates into your website, trading platform, company intranet/extranet, advisory portal and mobile applications to provide up-to-date financial market data, news and analytics and powerful investment tools.\n",
1111
"\n",
12-
"TRKD offers a wide range of Refinitiv' information and services delivered in a request-response scenario via web services using today's industry standard protocols (SOAP/XML and REST/JSON). Connectivity can be via HTTP and HTTPS, over the Internet or Delivery Direct. All data are snapshot (non-streaming) data.\n",
12+
"RKD offers a wide range of Refinitiv' information and services delivered in a request-response scenario via web services using today's industry standard protocols (SOAP/XML and REST/JSON). Connectivity can be via HTTP and HTTPS, over the Internet or Delivery Direct. All data are snapshot (non-streaming) data.\n",
1313
"\n",
14-
"This is an example project that shows how to implement TRKD HTTP JSON client with Python programming lanugage in Jupyter Notebook.\n",
14+
"This is an example project that shows how to implement RKD HTTP JSON client with Python programming lanugage in Jupyter Notebook.\n",
1515
"\n",
16-
"### TRKD JSON application implementation process\n",
17-
"The JSON application requires the following steps to consume data from TRKD API services\n",
18-
"1. Authentication with TRKD Authentication service to get an authen token\n",
19-
"2. Send a request message with the required input information and authen token to the interested TRKD service"
16+
"### RKD JSON application implementation process\n",
17+
"The JSON application requires the following steps to consume data from RKD API services\n",
18+
"1. Authentication with RKD Authentication service to get an authen token\n",
19+
"2. Send a request message with the required input information and authen token to the interested RKD service"
2020
]
2121
},
2222
{
@@ -74,11 +74,11 @@
7474
"metadata": {},
7575
"outputs": [],
7676
"source": [
77-
"# Input your TRKD credentials here\n",
77+
"# Input your RKD credentials here\n",
7878
"\n",
79-
"username = \"\"\n",
80-
"password = \"\"\n",
81-
"appid = \"\""
79+
"username = ''\n",
80+
"password = ''\n",
81+
"appid = ''"
8282
]
8383
},
8484
{
@@ -97,18 +97,18 @@
9797
"cell_type": "markdown",
9898
"metadata": {},
9999
"source": [
100-
"#### TRKD Service Token Detail\n",
101-
"##### TRKD Service Token URL and Header\n",
100+
"#### RKD Service Token Detail\n",
101+
"##### RKD Service Token URL and Header\n",
102102
"\n",
103-
"The URL enponint for the TRKD Service Token is following:\n",
104-
"[https://api.trkd.thomsonreuters.com/api/TokenManagement/TokenManagement.svc/REST/Anonymous/TokenManagement_1/CreateServiceToken_1](https://api.trkd.thomsonreuters.com/api/TokenManagement/TokenManagement.svc/REST/Anonymous/TokenManagement_1/CreateServiceToken_1)\n",
103+
"The URL enponint for the RKD Service Token is following:\n",
104+
"[https://api.rkd.refinitiv.com/api/TokenManagement/TokenManagement.svc/REST/Anonymous/TokenManagement_1/CreateServiceToken_1](https://api.rkd.refinitiv.com/api/TokenManagement/TokenManagement.svc/REST/Anonymous/TokenManagement_1/CreateServiceToken_1)\n",
105105
"\n",
106106
"Header: \n",
107107
"- Content-type = application/json;charset=utf-8\n",
108108
"Method:\n",
109109
"- Post\n",
110110
"\n",
111-
"##### TRKD Service TOKEN Request Message\n",
111+
"##### RKD Service TOKEN Request Message\n",
112112
"\n",
113113
"The CreateServiceToken_1 operation requires the following information to perform authentication\n",
114114
"- ApplicationID\n",
@@ -145,21 +145,21 @@
145145
"metadata": {},
146146
"outputs": [],
147147
"source": [
148-
"# TRKD Authentication Post Request message\n",
148+
"# RKD Authentication Post Request message\n",
149149
"\n",
150150
"authenMsg = {'CreateServiceToken_Request_1': {'ApplicationID': appid, 'Username': username, 'Password': password}}"
151151
]
152152
},
153153
{
154154
"cell_type": "code",
155-
"execution_count": null,
155+
"execution_count": 1,
156156
"metadata": {},
157157
"outputs": [],
158158
"source": [
159-
"# TRKD Authentication Service URL\n",
159+
"# RKD Authentication Service URL\n",
160160
"\n",
161161
"authenURL = (\n",
162-
" 'https://api.trkd.thomsonreuters.com/api/'\n",
162+
" 'https://api.rkd.refinitiv.com/api/'\n",
163163
" 'TokenManagement/TokenManagement.svc/REST/'\n",
164164
" 'Anonymous/TokenManagement_1/CreateServiceToken_1'\n",
165165
")"
@@ -171,7 +171,7 @@
171171
"metadata": {},
172172
"outputs": [],
173173
"source": [
174-
"# TRKD Authentication Request headers\n",
174+
"# RKD Authentication Request headers\n",
175175
"\n",
176176
"authen_headers = {'content-type': 'application/json;charset=utf-8'}"
177177
]
@@ -182,7 +182,7 @@
182182
"metadata": {},
183183
"outputs": [],
184184
"source": [
185-
"print('############### Sending Authentication request message to TRKD ###############')"
185+
"print('############### Sending Authentication request message to RKD ###############')"
186186
]
187187
},
188188
{
@@ -230,7 +230,7 @@
230230
"metadata": {},
231231
"source": [
232232
"## Conclusion\n",
233-
"All TRKD HTTP JSON applications require authenticaiton to access TRKD data. The application needs to request for Service Token from TRKD server, then keeps a response Service Token for later use in other request message header."
233+
"All RKD HTTP JSON applications require authenticaiton to access RKD data. The application needs to request for Service Token from RKD server, then keeps a response Service Token for later use in other request message header."
234234
]
235235
},
236236
{
@@ -239,12 +239,12 @@
239239
"source": [
240240
"## References\n",
241241
"For further details, please check out the following resources:\n",
242-
"* [Thomson Reuters Knowledge Direct API page](https://developers.refinitiv.com/thomson-reuters-knowledge-direct-trkd) on the [Refinitiv Developer Community](https://developers.thomsonreuters.com/) web site.\n",
243-
"* [Thomson Reuters Knowledge Direct API Catalog](https://www.trkd.thomsonreuters.com/SupportSite/RequestBuilder/requestbuilder.aspx) web site.\n",
244-
"* TRKD Article: [How to implement TRKD JSON application with Python chapter 1: the basic](https://developers.refinitiv.com/article/how-implement-trkd-json-application-python-chapter-1-basic)\n",
245-
"* [TRKD Tutorial](https://developers.refinitiv.com/thomson-reuters-knowledge-direct-trkd/thomson-reuters-knowledge-direct-api-trkd-api/learning).\n",
242+
"* [Refinitiv Knowledge Direct API page](https://developers.refinitiv.com/thomson-reuters-knowledge-direct-trkd) on the [Refinitiv Developer Community](https://developers.refinitiv.com) web site.\n",
243+
"* [Refinitiv Knowledge Direct API Catalog](https://www.trkd.thomsonreuters.com/SupportSite/RequestBuilder/requestbuilder.aspx) web site.\n",
244+
"* RKD Article: [How to implement RKD JSON application with Python chapter 1: the basic](https://developers.refinitiv.com/article/how-implement-trkd-json-application-python-chapter-1-basic)\n",
245+
"* [RKD Tutorial](https://developers.refinitiv.com/thomson-reuters-knowledge-direct-trkd/thomson-reuters-knowledge-direct-api-trkd-api/learning).\n",
246246
"\n",
247-
"For any question related to this tutorial or TRKD API, please use the Developer Community [Q&A Forum](https://community.developers.refinitiv.com/spaces/51/view.html)."
247+
"For any question related to this tutorial or RKD API, please use the Developer Community [Q&A Forum](https://community.developers.refinitiv.com/spaces/51/view.html)."
248248
]
249249
},
250250
{
@@ -271,7 +271,7 @@
271271
"name": "python",
272272
"nbconvert_exporter": "python",
273273
"pygments_lexer": "ipython3",
274-
"version": "3.7.3"
274+
"version": "3.7.6"
275275
}
276276
},
277277
"nbformat": 4,

0 commit comments

Comments
 (0)