|
20 | 20 | "You will also require an App Key that uniquely identifies your application. Please refer to the Refinitiv Data Libraries Quick Start guide's **Access Credentials** section for instructions on creating an App Key." |
21 | 21 | ] |
22 | 22 | }, |
| 23 | + { |
| 24 | + "cell_type": "markdown", |
| 25 | + "id": "c77f2e4c-c19f-4a6c-ac1e-31d1678a28b4", |
| 26 | + "metadata": {}, |
| 27 | + "source": [ |
| 28 | + "## Set the configuration file location\n", |
| 29 | + "For ease of use, we offer the option of setting various initialization parameters of the Refinitiv Data Library in the _refinitiv-data.config.json_ configuration file. \n", |
| 30 | + "\n", |
| 31 | + "Typically you would place this file in the same folder as your Notebook or Python script.\n", |
| 32 | + "Alternatively, you can place the file in an alternative folder as specified using the _RD_LIB_CONFIG_PATH_ environment variable. \n", |
| 33 | + "\n", |
| 34 | + "As these tutorial Notebooks are in Categorised sub-folders and to avoid the need for multiple config files (in each folder), we will use the _RD_LIB_CONFIG_PATH_ environment variable to point to a single instance of the config file in the top-level ***Configuration*** folder." |
| 35 | + ] |
| 36 | + }, |
| 37 | + { |
| 38 | + "cell_type": "code", |
| 39 | + "execution_count": 1, |
| 40 | + "id": "4c9f9a18-4960-43bf-aeeb-9a60ce748084", |
| 41 | + "metadata": {}, |
| 42 | + "outputs": [], |
| 43 | + "source": [ |
| 44 | + "import os\n", |
| 45 | + "os.environ[\"RD_LIB_CONFIG_PATH\"] = \"../../../Configuration\"" |
| 46 | + ] |
| 47 | + }, |
23 | 48 | { |
24 | 49 | "cell_type": "markdown", |
25 | 50 | "id": "560d68d9", |
|
30 | 55 | }, |
31 | 56 | { |
32 | 57 | "cell_type": "code", |
33 | | - "execution_count": 1, |
| 58 | + "execution_count": null, |
34 | 59 | "id": "e801bb0e", |
35 | 60 | "metadata": {}, |
36 | 61 | "outputs": [], |
|
50 | 75 | "* connectivity parameters \n", |
51 | 76 | "\n", |
52 | 77 | "for the various session types. \n", |
| 78 | + "\n", |
| 79 | + "### Easiest way to Create & Open a Session\n", |
| 80 | + "\n", |
53 | 81 | "Using the config file, where possible, provides the simplest approach to creating and opening sessions. \n", |
54 | | - "For example, assuming you have specified a 'default' session in the config file, you can create and open the default session as follows:" |
| 82 | + "For example, assuming you have \n", |
| 83 | + "* a '*refinitiv-data.config.json*' in the current working directory \n", |
| 84 | + "* and specified a 'default' session in the config file \n", |
| 85 | + "\n", |
| 86 | + "you can create and open the default session as follows:" |
55 | 87 | ] |
56 | 88 | }, |
57 | 89 | { |
|
89 | 121 | "metadata": {}, |
90 | 122 | "outputs": [], |
91 | 123 | "source": [ |
92 | | - "rd.open_session(name = 'platform.deployed')" |
| 124 | + "rd.open_session(name='platform.deployed')" |
93 | 125 | ] |
94 | 126 | }, |
95 | 127 | { |
|
117 | 149 | "metadata": {}, |
118 | 150 | "outputs": [], |
119 | 151 | "source": [ |
120 | | - "rd.open_session(config_name=\"refinitiv-data.custom.config.json\")" |
| 152 | + "rd.open_session(config_name=\"../Configuration/refinitiv-data.config.json\")" |
121 | 153 | ] |
122 | 154 | }, |
123 | 155 | { |
|
128 | 160 | "<br> \n", |
129 | 161 | "Alternatively, if you do not wish to use the refinitiv-data config file, you can define sessions by specifying the parameters and session type explicitly - as shown below.\n", |
130 | 162 | "\n", |
131 | | - "## Define the session of your choice\n", |
132 | | - "The following example calls use credentials/connectivity parameters as defined in the **Configuration//credentials.ipynb** file. \n", |
133 | | - "\n", |
134 | | - "Please edit **Configuration/credentials.ipynb** to set your credentials and run the next cell before continuing" |
| 163 | + "## Define the session using your own credentials store\n", |
| 164 | + "Sessions can be created by explicitly passing in your credentials/connectivity parameters.\n", |
| 165 | + "For example, the following calls use credentials/connectivity parameters defined inthe cell below.\n", |
| 166 | + "Please edit the following cell to set your credentials and execute, before continuing." |
135 | 167 | ] |
136 | 168 | }, |
137 | 169 | { |
|
141 | 173 | "metadata": {}, |
142 | 174 | "outputs": [], |
143 | 175 | "source": [ |
144 | | - "%run ../Configuration/credentials.ipynb" |
| 176 | + "APP_KEY = 'YOUR_APP_KEY'\n", |
| 177 | + "RDP_LOGIN = 'YOUR_REFINITIV_DATA_PLATFORM_LOGIN'\n", |
| 178 | + "RDP_PASSWORD = 'YOUR_REFINITIV_DATA_PLATFORM_PASSWORD'\n", |
| 179 | + "REALTIME_DISTRIBUTION_SERVICE_HOST = 'THE_HOST:PORT_OF_YOUR_RTDS_HOST' \n", |
| 180 | + "REALTIME_DISTRIBUTION_SERVICE_USER_NAME = 'YOUR_USER_NAME_ON_YOUR_RTDS_HOST' " |
145 | 181 | ] |
146 | 182 | }, |
147 | 183 | { |
|
156 | 192 | }, |
157 | 193 | { |
158 | 194 | "cell_type": "code", |
159 | | - "execution_count": 2, |
| 195 | + "execution_count": null, |
160 | 196 | "id": "51fad442", |
161 | 197 | "metadata": {}, |
162 | 198 | "outputs": [], |
|
207 | 243 | "source": [ |
208 | 244 | "session = rd.session.platform.Definition(\n", |
209 | 245 | " app_key = APP_KEY, \n", |
210 | | - " deployed_platform_host = DEPLOYED_PLATFORM_HOST,\n", |
211 | | - " deployed_platform_username = DEPLOYED_PLATFORM_USER_NAME\n", |
| 246 | + " deployed_platform_host = REALTIME_DISTRIBUTION_SERVICE_HOST,\n", |
| 247 | + " deployed_platform_username = REALTIME_DISTRIBUTION_SERVICE_USER_NAME\n", |
212 | 248 | ").get_session()" |
213 | 249 | ] |
214 | 250 | }, |
|
237 | 273 | " username = RDP_LOGIN, \n", |
238 | 274 | " password = RDP_PASSWORD\n", |
239 | 275 | " ),\n", |
240 | | - " deployed_platform_host = DEPLOYED_PLATFORM_HOST,\n", |
241 | | - " deployed_platform_username = DEPLOYED_PLATFORM_USER_NAME\n", |
| 276 | + " deployed_platform_host = REALTIME_DISTRIBUTION_SERVICE_HOST,\n", |
| 277 | + " deployed_platform_username = REALTIME_DISTRIBUTION_SERVICE_USER_NAME\n", |
242 | 278 | ").get_session()" |
243 | 279 | ] |
244 | 280 | }, |
|
293 | 329 | }, |
294 | 330 | { |
295 | 331 | "cell_type": "code", |
296 | | - "execution_count": 4, |
| 332 | + "execution_count": null, |
297 | 333 | "id": "f628d577", |
298 | 334 | "metadata": {}, |
299 | | - "outputs": [ |
300 | | - { |
301 | | - "data": { |
302 | | - "text/plain": [ |
303 | | - "<SessionState.Closed: 1>" |
304 | | - ] |
305 | | - }, |
306 | | - "execution_count": 4, |
307 | | - "metadata": {}, |
308 | | - "output_type": "execute_result" |
309 | | - } |
310 | | - ], |
| 335 | + "outputs": [], |
311 | 336 | "source": [ |
312 | 337 | "session.close()" |
313 | 338 | ] |
|
358 | 383 | }, |
359 | 384 | { |
360 | 385 | "cell_type": "code", |
361 | | - "execution_count": 6, |
| 386 | + "execution_count": null, |
362 | 387 | "id": "f2bfad89-53d1-4e22-9903-3eba81159252", |
363 | 388 | "metadata": {}, |
364 | 389 | "outputs": [], |
|
0 commit comments