You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ALL EXAMPLE CODE IS PROVIDED ON AN “AS IS” AND “AS AVAILABLE” BASIS FOR ILLUSTRATIVE PURPOSES ONLY. REFINITIV MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, AS TO THE OPERATION OF THE EXAMPLE CODE, OR THE INFORMATION, CONTENT, OR MATERIALS USED IN CONNECTION WITH THE EXAMPLE CODE. YOU EXPRESSLY AGREE THAT YOUR USE OF THE EXAMPLE CODE IS AT YOUR SOLE RISK.
10
+
8
11
## <aid="overview"></a>Overview
9
12
The [Refinitiv Knowledge Direct (RKD) API](https://developers.refinitiv.com/en/api-catalog/refinitiv-knowledge-direct/refinitiv-knowledge-direct-api-rkd-api) (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.
10
13
@@ -35,41 +38,71 @@ All source code and scripts are provided under the Apache 2.0 license. They are
35
38
36
39
## <aid="prerequisite"></a>Prerequisite
37
40
The following softwares are required to use this script
38
-
- RKD API credentials. Please reach out to your Refinitiv sales associate to acquire RKD access credentials.
39
-
-[Python 3](https://www.python.org/).
40
-
- The [requests](http://docs.python-requests.org/en/master/) library
41
-
- The [websocket-client](https://pypi.org/project/websocket-client/) library (*version 0.49 or greater*, for trkd_wsstreaming.py application only)
42
-
- The [python-dateutil](https://pypi.org/project/python-dateutil/) library (for trkd_wsstreaming.py application only)
43
-
- The [classic Jupyter Notebook](https://jupyter.org/) runtime (for the Notebook example application)
41
+
- RKD API credentials. Please reach out to your Refinitiv representative to acquire RKD access credentials.
42
+
- Python [Anaconda](https://www.anaconda.com/distribution/) or [MiniConda](https://docs.conda.io/en/latest/miniconda.html) distribution/package manager.
43
+
- The [JupyterLab](https://jupyter.org/) runtime (for the Notebook example application)
44
44
45
45
All scripts support Python 3 only and not compatible with Python 2.
46
46
47
47
*Note:*
48
48
- 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.
49
49
50
-
## <aid="run_console"></a>How to run the script
51
-
Run the script via the command line (or shell)
52
-
```
53
-
$>python <application>.py
54
-
```
55
-
56
-
## <aid="library_install"></a>Optional - How to install libraries for console examples
57
-
The best way is via the pip package management tool
58
-
1. export <Python_folder>\Scripts to your OS PATH environment
59
-
2. call pip command to install requests
60
-
```
61
-
$>pip install -r requirements.txt
62
-
```
63
-
3. If you are behind proxy, set the proxy first
64
-
```
65
-
export https_proxy="http://<proxy.server>:<port>"
66
-
$>pip install -r requirements.txt
67
-
```
68
-
69
-
*Note*: If you aim to use only RKD HTTP JSON services, you can just install requests library via a ```pip install requests``` command.
70
-
71
-
## <aid="run_notebook"></a>Optional - How to install libraries for notebook examples
72
-
Please follow the [classic Jupyter Notebook installation guide](https://jupyter.org/install) page.
50
+
51
+
### <aid="python_example_run"></a>How to run the Python Console examples
52
+
53
+
1. Open Anaconda Prompt and go to the project's Python folder
54
+
2. Run the following command in the Anaconda Prompt application to create a Conda environment named *RKD_Python* for the project.
3. Once the environment is created, activate a Conda environment named ```RKD_Python``` with this command in Anaconda Prompt.
59
+
```
60
+
(base) $>conda activate RKD_Python
61
+
```
62
+
4. Run the following command to the dependencies in the *RKD_Python* environment with a **requirements.txt** file.
63
+
```
64
+
(RKD_Python) $>pip install -r requirements.txt
65
+
```
66
+
5. Once the dependencies installation process success, Go to the project's Python folder. and create a file name ```.env``` with the following content.
67
+
```
68
+
#RKD Access Credentials
69
+
RKD_USERNAME=<RKD Username>
70
+
RKD_PASSWORD=<RKD Password>
71
+
RKD_APP_ID=<RKD App ID>
72
+
```
73
+
6. Run the script via the command line (or shell)
74
+
```
75
+
(RKD_Python) $>python <application>.py
76
+
```
77
+
78
+
### <a id="python_example_run"></a>How to run the Python Notebook examples
79
+
80
+
1. Open Anaconda Prompt and go to the project's Python folder
81
+
2. Run the following command in the Anaconda Prompt application to create a Conda environment named *RKD_Python_Notebook* for the project.
5. Once the dependencies installation process success, Go to the project's notebook folder. and create a file name ```.env``` with the following content.
94
+
```
95
+
#RKD Access Credentials
96
+
RKD_USERNAME=<RKD Username>
97
+
RKD_PASSWORD=<RKD Password>
98
+
RKD_APP_ID=<RKD App ID>
99
+
```
100
+
6. Run the following command to start the Jupyter Lab application
101
+
```
102
+
(RKD_Python_Notebook) $>notebook>jupyter lab
103
+
```
104
+
105
+
Please follow the [JupyterLab installation guide](https://jupyter.org/install) page.
73
106
74
107
## <a id="rdp"></a>RDP and Refinitiv Real-Time - Optimized
75
108
@@ -129,16 +162,16 @@ For further details, please check out the following resources:
129
162
- version 1.0.10: 9 Aug 2018
130
163
- remove all ```is not None``` statements and make them a bit more **Pythonic**.
131
164
- version 1.0.11: January 2019
132
-
- Add trkd_wsstreaming.py application for TRKD Streaming service.
165
+
- Add trkd_wsstreaming.py application for RKD Streaming service.
133
166
- Add License.md file
134
167
- version 1.0.12: March 2019
135
168
- Change all scripts to print JSON message in beauty format.
136
169
- version 1.5: July 2019
137
-
- Add TRKD Authentication Jupyter Notebook.
170
+
- Add RKD Authentication Jupyter Notebook.
138
171
- version 1.5.1: July 2019
139
-
- Add TRKD Interday and Intraday Jupyter Notebooks.
172
+
- Add RKD Interday and Intraday Jupyter Notebooks.
140
173
- version 1.5.2: October 2019
141
-
- Update TRKD Interday and Intraday services operations.
174
+
- Update RKD Interday and Intraday services operations.
142
175
- version 1.5.3: May 2020
143
176
- Update RDP and Refinitiv Real-Time - Optimized information.
144
177
- version 1.5.4: June 2020
@@ -147,3 +180,7 @@ For further details, please check out the following resources:
147
180
- version 1.5.5: May 2021
148
181
- Re-branding Product names and URLs.
149
182
- add trkd_wsstreaming.py Batch support.
183
+
- version 1.6.0: Mar 2022
184
+
- Add ```dotenv``` and Environment Variable for credentials
185
+
- Update requirements.txt and requirements-notebook.txt files
0 commit comments