|
4 | 4 | "cell_type": "markdown", |
5 | 5 | "metadata": {}, |
6 | 6 | "source": [ |
7 | | - "----\n", |
8 | | - "<img src=\"../../../files/refinitiv.png\" width=\"20%\" style=\"vertical-align: top;\">\n", |
9 | | - "\n", |
10 | | - "# Data Library for Python\n", |
11 | | - "\n", |
12 | | - "----" |
| 7 | + "# Refinitiv Data Library for Python" |
13 | 8 | ] |
14 | 9 | }, |
15 | 10 | { |
16 | 11 | "cell_type": "markdown", |
17 | 12 | "metadata": {}, |
18 | 13 | "source": [ |
19 | | - "## Delivery layer - Bulk - Package Manager\n", |
| 14 | + "## Content layer - Bulk - Package Manager\n", |
20 | 15 | "This notebook demonstrates how to use the Refinitiv Data Library to retrieve data from Refinitiv Data Platform bulk feeds. In this example you will see how to use the bulk Package Manager of the Delivery layer to:\n", |
21 | 16 | " - Download ESG bulk files\n", |
22 | 17 | " - Populate a database with their content\n", |
|
29 | 24 | }, |
30 | 25 | { |
31 | 26 | "cell_type": "markdown", |
32 | | - "metadata": {}, |
| 27 | + "metadata": { |
| 28 | + "jp-MarkdownHeadingCollapsed": true, |
| 29 | + "tags": [] |
| 30 | + }, |
33 | 31 | "source": [ |
34 | 32 | "#### Learn more\n", |
35 | 33 | "\n", |
|
48 | 46 | }, |
49 | 47 | { |
50 | 48 | "cell_type": "markdown", |
51 | | - "metadata": {}, |
| 49 | + "metadata": { |
| 50 | + "tags": [] |
| 51 | + }, |
52 | 52 | "source": [ |
53 | 53 | "## Set the configuration file location\n", |
54 | 54 | "For a better ease of use, you have the option to set initialization parameters of the Refinitiv Data Library in the _refinitiv-data.config.json_ configuration file. This file must be located beside your notebook, in your user folder or in a folder defined by the _RD_LIB_CONFIG_PATH_ environment variable. The _RD_LIB_CONFIG_PATH_ environment variable is the option used by this series of examples. The following code sets this environment variable. " |
|
73 | 73 | }, |
74 | 74 | { |
75 | 75 | "cell_type": "code", |
76 | | - "execution_count": 2, |
| 76 | + "execution_count": 1, |
77 | 77 | "metadata": {}, |
78 | 78 | "outputs": [], |
79 | 79 | "source": [ |
80 | 80 | "import refinitiv.data as rd\n", |
81 | | - "from refinitiv.data.delivery import bulk" |
| 81 | + "from refinitiv.data.content.esg import bulk" |
82 | 82 | ] |
83 | 83 | }, |
84 | 84 | { |
|
92 | 92 | }, |
93 | 93 | { |
94 | 94 | "cell_type": "code", |
95 | | - "execution_count": 3, |
| 95 | + "execution_count": 2, |
96 | 96 | "metadata": {}, |
97 | 97 | "outputs": [ |
98 | 98 | { |
99 | 99 | "data": { |
100 | 100 | "text/plain": [ |
101 | | - "<refinitiv.data.session.platform.Definition object at 0x7fd2362fcdd0 {session_name='rdp'}>" |
| 101 | + "<refinitiv.data.session.platform.Definition object at 0x7fb5101fcee0 {session_name='rdp'}>" |
102 | 102 | ] |
103 | 103 | }, |
104 | | - "execution_count": 3, |
| 104 | + "execution_count": 2, |
105 | 105 | "metadata": {}, |
106 | 106 | "output_type": "execute_result" |
107 | 107 | } |
|
126 | 126 | }, |
127 | 127 | { |
128 | 128 | "cell_type": "code", |
129 | | - "execution_count": 4, |
| 129 | + "execution_count": 3, |
130 | 130 | "metadata": { |
131 | 131 | "tags": [] |
132 | 132 | }, |
133 | 133 | "outputs": [ |
134 | 134 | { |
135 | 135 | "data": { |
136 | 136 | "text/plain": [ |
137 | | - "<ConfigurationSet: 0x7fd2345c7f50>" |
| 137 | + "<ConfigurationSet: 0x7fb5101ee430>" |
138 | 138 | ] |
139 | 139 | }, |
140 | | - "execution_count": 4, |
| 140 | + "execution_count": 3, |
141 | 141 | "metadata": {}, |
142 | 142 | "output_type": "execute_result" |
143 | 143 | } |
144 | 144 | ], |
145 | 145 | "source": [ |
146 | | - "rd.load_config(\"./refinitiv-data.bulk.config.json\")" |
| 146 | + "rd.load_config(\"refinitiv-data.bulk.config.json\")" |
147 | 147 | ] |
148 | 148 | }, |
149 | 149 | { |
|
156 | 156 | }, |
157 | 157 | { |
158 | 158 | "cell_type": "code", |
159 | | - "execution_count": 5, |
| 159 | + "execution_count": 4, |
160 | 160 | "metadata": { |
161 | 161 | "tags": [] |
162 | 162 | }, |
163 | 163 | "outputs": [], |
164 | 164 | "source": [ |
165 | | - "pkg_manager = rd.delivery.bulk.PackageManager('esg.standard_scores')" |
| 165 | + "pkg_manager = bulk.PackageManager('esg.standard_scores')" |
166 | 166 | ] |
167 | 167 | }, |
168 | 168 | { |
|
175 | 175 | }, |
176 | 176 | { |
177 | 177 | "cell_type": "code", |
178 | | - "execution_count": 6, |
| 178 | + "execution_count": 5, |
179 | 179 | "metadata": {}, |
180 | 180 | "outputs": [], |
181 | 181 | "source": [ |
|
193 | 193 | }, |
194 | 194 | { |
195 | 195 | "cell_type": "code", |
196 | | - "execution_count": 7, |
| 196 | + "execution_count": 6, |
197 | 197 | "metadata": { |
198 | 198 | "pycharm": { |
199 | 199 | "name": "#%%\n" |
|
213 | 213 | }, |
214 | 214 | { |
215 | 215 | "cell_type": "code", |
216 | | - "execution_count": 8, |
| 216 | + "execution_count": 7, |
217 | 217 | "metadata": {}, |
218 | 218 | "outputs": [ |
219 | 219 | { |
|
251 | 251 | " <tbody>\n", |
252 | 252 | " <tr>\n", |
253 | 253 | " <th>0</th>\n", |
254 | | - " <td>Southwest Securities Co Ltd</td>\n", |
255 | | - " <td>2021-12-05</td>\n", |
| 254 | + " <td>null</td>\n", |
| 255 | + " <td>2022-06-19</td>\n", |
256 | 256 | " <td>4295865175</td>\n", |
257 | | - " <td>2018-12-31T00:00:00.000Z</td>\n", |
258 | | - " <td>0.35004234242517784</td>\n", |
259 | | - " <td>0.35004234242517784</td>\n", |
260 | | - " <td>0.018253968253968234</td>\n", |
261 | | - " <td>0.1190817000660648</td>\n", |
262 | | - " <td>0.6446122860020144</td>\n", |
| 257 | + " <td>2019-12-31T00:00:00.000Z</td>\n", |
| 258 | + " <td>0.29947279270624544</td>\n", |
| 259 | + " <td>0.29947279270624544</td>\n", |
| 260 | + " <td>0.01709401709401708</td>\n", |
| 261 | + " <td>0.18333944617641684</td>\n", |
| 262 | + " <td>0.48225458468176935</td>\n", |
263 | 263 | " </tr>\n", |
264 | 264 | " <tr>\n", |
265 | 265 | " <th>1</th>\n", |
266 | | - " <td>Southwest Securities Co Ltd</td>\n", |
267 | | - " <td>2021-12-05</td>\n", |
| 266 | + " <td>null</td>\n", |
| 267 | + " <td>2022-06-19</td>\n", |
268 | 268 | " <td>4295865175</td>\n", |
269 | | - " <td>2019-12-31T00:00:00.000Z</td>\n", |
270 | | - " <td>0.29754835714404315</td>\n", |
271 | | - " <td>0.29754835714404315</td>\n", |
272 | | - " <td>0.018822100789313883</td>\n", |
273 | | - " <td>0.1791604892512974</td>\n", |
274 | | - " <td>0.4811382113821141</td>\n", |
| 269 | + " <td>2020-12-31T00:00:00.000Z</td>\n", |
| 270 | + " <td>0.24168438802878833</td>\n", |
| 271 | + " <td>0.24168438802878833</td>\n", |
| 272 | + " <td>0.018518518518518497</td>\n", |
| 273 | + " <td>0.246007821411113</td>\n", |
| 274 | + " <td>0.3049832495812397</td>\n", |
275 | 275 | " </tr>\n", |
276 | 276 | " <tr>\n", |
277 | 277 | " <th>2</th>\n", |
278 | | - " <td>Southwest Securities Co Ltd</td>\n", |
279 | | - " <td>2021-12-05</td>\n", |
| 278 | + " <td>null</td>\n", |
| 279 | + " <td>2022-06-19</td>\n", |
280 | 280 | " <td>4295865175</td>\n", |
281 | | - " <td>2020-12-31T00:00:00.000Z</td>\n", |
282 | | - " <td>0.27082704253620765</td>\n", |
283 | | - " <td>0.27082704253620765</td>\n", |
284 | | - " <td>0.02034428794992173</td>\n", |
285 | | - " <td>0.2417921814181757</td>\n", |
286 | | - " <td>0.37049019607843153</td>\n", |
| 281 | + " <td>2021-12-31T00:00:00.000Z</td>\n", |
| 282 | + " <td>0.1533037065733652</td>\n", |
| 283 | + " <td>0.1533037065733652</td>\n", |
| 284 | + " <td>0.0173160173160173</td>\n", |
| 285 | + " <td>0.22050405469868026</td>\n", |
| 286 | + " <td>0.13735305271141454</td>\n", |
287 | 287 | " </tr>\n", |
288 | 288 | " </tbody>\n", |
289 | 289 | "</table>\n", |
290 | 290 | "</div>" |
291 | 291 | ], |
292 | 292 | "text/plain": [ |
293 | | - " OrganizationName InsertDate Instrument \\\n", |
294 | | - "0 Southwest Securities Co Ltd 2021-12-05 4295865175 \n", |
295 | | - "1 Southwest Securities Co Ltd 2021-12-05 4295865175 \n", |
296 | | - "2 Southwest Securities Co Ltd 2021-12-05 4295865175 \n", |
| 293 | + " OrganizationName InsertDate Instrument PeriodEndDate \\\n", |
| 294 | + "0 null 2022-06-19 4295865175 2019-12-31T00:00:00.000Z \n", |
| 295 | + "1 null 2022-06-19 4295865175 2020-12-31T00:00:00.000Z \n", |
| 296 | + "2 null 2022-06-19 4295865175 2021-12-31T00:00:00.000Z \n", |
297 | 297 | "\n", |
298 | | - " PeriodEndDate TR.TRESGCScore TR.TRESGScore \\\n", |
299 | | - "0 2018-12-31T00:00:00.000Z 0.35004234242517784 0.35004234242517784 \n", |
300 | | - "1 2019-12-31T00:00:00.000Z 0.29754835714404315 0.29754835714404315 \n", |
301 | | - "2 2020-12-31T00:00:00.000Z 0.27082704253620765 0.27082704253620765 \n", |
| 298 | + " TR.TRESGCScore TR.TRESGScore TR.EnvironmentPillarScore \\\n", |
| 299 | + "0 0.29947279270624544 0.29947279270624544 0.01709401709401708 \n", |
| 300 | + "1 0.24168438802878833 0.24168438802878833 0.018518518518518497 \n", |
| 301 | + "2 0.1533037065733652 0.1533037065733652 0.0173160173160173 \n", |
302 | 302 | "\n", |
303 | | - " TR.EnvironmentPillarScore TR.SocialPillarScore TR.GovernancePillarScore \n", |
304 | | - "0 0.018253968253968234 0.1190817000660648 0.6446122860020144 \n", |
305 | | - "1 0.018822100789313883 0.1791604892512974 0.4811382113821141 \n", |
306 | | - "2 0.02034428794992173 0.2417921814181757 0.37049019607843153 " |
| 303 | + " TR.SocialPillarScore TR.GovernancePillarScore \n", |
| 304 | + "0 0.18333944617641684 0.48225458468176935 \n", |
| 305 | + "1 0.246007821411113 0.3049832495812397 \n", |
| 306 | + "2 0.22050405469868026 0.13735305271141454 " |
307 | 307 | ] |
308 | 308 | }, |
309 | | - "execution_count": 8, |
| 309 | + "execution_count": 7, |
310 | 310 | "metadata": {}, |
311 | 311 | "output_type": "execute_result" |
312 | 312 | } |
313 | 313 | ], |
314 | 314 | "source": [ |
315 | | - "response = rd.delivery.bulk.Definition(\"esg.standard_scores\", universe = \"4295865175\").get_db_data()\n", |
| 315 | + "response = bulk.Definition(\"esg.standard_scores\", universe = \"4295865175\").get_db_data()\n", |
316 | 316 | "response.data.df" |
317 | 317 | ] |
318 | 318 | }, |
|
332 | 332 | }, |
333 | 333 | { |
334 | 334 | "cell_type": "code", |
335 | | - "execution_count": 9, |
| 335 | + "execution_count": 8, |
336 | 336 | "metadata": { |
337 | 337 | "pycharm": { |
338 | 338 | "name": "#%%\n" |
|
352 | 352 | }, |
353 | 353 | { |
354 | 354 | "cell_type": "code", |
355 | | - "execution_count": 8, |
| 355 | + "execution_count": null, |
356 | 356 | "metadata": { |
357 | 357 | "pycharm": { |
358 | 358 | "name": "#%%\n" |
|
372 | 372 | }, |
373 | 373 | { |
374 | 374 | "cell_type": "code", |
375 | | - "execution_count": 12, |
| 375 | + "execution_count": 10, |
376 | 376 | "metadata": {}, |
377 | 377 | "outputs": [], |
378 | 378 | "source": [ |
|
388 | 388 | }, |
389 | 389 | { |
390 | 390 | "cell_type": "code", |
391 | | - "execution_count": 10, |
| 391 | + "execution_count": 11, |
392 | 392 | "metadata": { |
393 | 393 | "pycharm": { |
394 | 394 | "name": "#%%\n" |
|
409 | 409 | ], |
410 | 410 | "metadata": { |
411 | 411 | "kernelspec": { |
412 | | - "display_name": "Python 3", |
| 412 | + "display_name": "Python 3 (ipykernel)", |
413 | 413 | "language": "python", |
414 | 414 | "name": "python3" |
415 | 415 | }, |
|
423 | 423 | "name": "python", |
424 | 424 | "nbconvert_exporter": "python", |
425 | 425 | "pygments_lexer": "ipython3", |
426 | | - "version": "3.7.6" |
| 426 | + "version": "3.9.7" |
427 | 427 | } |
428 | 428 | }, |
429 | 429 | "nbformat": 4, |
|
0 commit comments