|
70 | 70 | { |
71 | 71 | "data": { |
72 | 72 | "text/plain": [ |
73 | | - "{'id': 'id:pgKT2sXX3sMAAAAAAAAJLQ',\n", |
| 73 | + "{'id': 'id:pgKT2sXX3sMAAAAAAAAJQg',\n", |
74 | 74 | " 'shared_folder_id': None,\n", |
75 | 75 | " 'sharing_info': None,\n", |
76 | 76 | " 'property_groups': None,\n", |
|
249 | 249 | " print(f.read())" |
250 | 250 | ] |
251 | 251 | }, |
252 | | - { |
253 | | - "cell_type": "markdown", |
254 | | - "metadata": {}, |
255 | | - "source": [ |
256 | | - "## Use find to list files" |
257 | | - ] |
258 | | - }, |
259 | 252 | { |
260 | 253 | "cell_type": "code", |
261 | 254 | "execution_count": 11, |
|
310 | 303 | "print(items)" |
311 | 304 | ] |
312 | 305 | }, |
313 | | - { |
314 | | - "cell_type": "markdown", |
315 | | - "metadata": {}, |
316 | | - "source": [ |
317 | | - "## Read with intake\n", |
318 | | - "\n", |
319 | | - "Note that the path used has three ///: The path needs to be dropbox:// + /folder1/folder2 \n", |
320 | | - "\n", |
321 | | - "Without it, the dropbox sdk used in background will take as cloud path : /folder2 instead of /folder1/folder2" |
322 | | - ] |
323 | | - }, |
324 | 306 | { |
325 | 307 | "cell_type": "code", |
326 | 308 | "execution_count": 13, |
327 | | - "metadata": { |
328 | | - "tags": [] |
329 | | - }, |
330 | | - "outputs": [], |
331 | | - "source": [ |
332 | | - "import intake" |
333 | | - ] |
334 | | - }, |
335 | | - { |
336 | | - "cell_type": "code", |
337 | | - "execution_count": 14, |
338 | | - "metadata": {}, |
339 | | - "outputs": [], |
340 | | - "source": [ |
341 | | - "file_intake = intake.open_textfiles(\"dropbox:///Data/test_dropbox/test.txt\",storage_options={\"token\":token})\n" |
342 | | - ] |
343 | | - }, |
344 | | - { |
345 | | - "cell_type": "code", |
346 | | - "execution_count": 15, |
347 | 309 | "metadata": {}, |
348 | 310 | "outputs": [ |
349 | 311 | { |
350 | | - "data": { |
351 | | - "text/plain": [ |
352 | | - "['Hello']" |
353 | | - ] |
354 | | - }, |
355 | | - "execution_count": 15, |
356 | | - "metadata": {}, |
357 | | - "output_type": "execute_result" |
| 312 | + "name": "stderr", |
| 313 | + "output_type": "stream", |
| 314 | + "text": [ |
| 315 | + "INFO:Request to files/list_folder\n", |
| 316 | + "INFO:Request to files/list_folder\n" |
| 317 | + ] |
| 318 | + }, |
| 319 | + { |
| 320 | + "name": "stdout", |
| 321 | + "output_type": "stream", |
| 322 | + "text": [ |
| 323 | + "[('/Data/test_dropbox', ['test_db'], ['text1.txt', 'test.txt', 'test (1).txt']), ('/Data/test_dropbox/test_db', [], ['test1.txt', 'test2.txt'])]\n" |
| 324 | + ] |
358 | 325 | } |
359 | 326 | ], |
360 | 327 | "source": [ |
361 | | - "file_intake.read()" |
362 | | - ] |
363 | | - }, |
364 | | - { |
365 | | - "cell_type": "markdown", |
366 | | - "metadata": {}, |
367 | | - "source": [ |
368 | | - "## List all files before removing the folder online" |
| 328 | + "items = fs.walk(\"/Data/test_dropbox\")\n", |
| 329 | + "print(list(items))" |
369 | 330 | ] |
370 | 331 | }, |
371 | 332 | { |
372 | 333 | "cell_type": "code", |
373 | | - "execution_count": 16, |
| 334 | + "execution_count": 14, |
374 | 335 | "metadata": {}, |
375 | 336 | "outputs": [ |
376 | 337 | { |
|
384 | 345 | "name": "stdout", |
385 | 346 | "output_type": "stream", |
386 | 347 | "text": [ |
387 | | - "{'id': 'id:pgKT2sXX3sMAAAAAAAAJMA', 'shared_folder_id': None, 'sharing_info': None, 'property_groups': None, 'name': '/Data/test_dropbox/test_db', 'size': None, 'type': 'directory'}\n", |
388 | | - "{'id': 'id:pgKT2sXX3sMAAAAAAAAJLg', 'client_modified': datetime.datetime(2024, 1, 18, 19, 47, 35), 'server_modified': datetime.datetime(2024, 1, 18, 19, 47, 35), 'rev': '60f3da29620a50f9d7ed4', 'size': 5, 'media_info': None, 'symlink_info': None, 'sharing_info': None, 'is_downloadable': True, 'export_info': None, 'property_groups': None, 'has_explicit_shared_members': None, 'content_hash': '9595c9df90075148eb06860365df33584b75bff782a510c6cd4883a419833d50', 'file_lock_info': None, 'name': '/Data/test_dropbox/text1.txt', 'type': 'file'}\n", |
389 | | - "{'id': 'id:pgKT2sXX3sMAAAAAAAAJMg', 'client_modified': datetime.datetime(2024, 1, 18, 19, 47, 40), 'server_modified': datetime.datetime(2024, 1, 18, 19, 47, 40), 'rev': '60f3da2e422580f9d7ed4', 'size': 5, 'media_info': None, 'symlink_info': None, 'sharing_info': None, 'is_downloadable': True, 'export_info': None, 'property_groups': None, 'has_explicit_shared_members': None, 'content_hash': '70bc18bef5ae66b72d1995f8db90a583a60d77b4066e4653f1cead613025861c', 'file_lock_info': None, 'name': '/Data/test_dropbox/test.txt', 'type': 'file'}\n", |
390 | | - "{'id': 'id:pgKT2sXX3sMAAAAAAAAJMw', 'client_modified': datetime.datetime(2024, 1, 18, 19, 47, 41), 'server_modified': datetime.datetime(2024, 1, 18, 19, 47, 41), 'rev': '60f3da2f7bf080f9d7ed4', 'size': 5, 'media_info': None, 'symlink_info': None, 'sharing_info': None, 'is_downloadable': True, 'export_info': None, 'property_groups': None, 'has_explicit_shared_members': None, 'content_hash': '63e5c163c81ee9a3ed99d365ff963ecea340cc455deeac7c4b63ac75b9cf4706', 'file_lock_info': None, 'name': '/Data/test_dropbox/test (1).txt', 'type': 'file'}\n", |
| 348 | + "{'id': 'id:pgKT2sXX3sMAAAAAAAAJRQ', 'shared_folder_id': None, 'sharing_info': None, 'property_groups': None, 'name': '/Data/test_dropbox/test_db', 'size': None, 'type': 'directory'}\n", |
| 349 | + "{'id': 'id:pgKT2sXX3sMAAAAAAAAJQw', 'client_modified': datetime.datetime(2024, 1, 18, 19, 56, 25), 'server_modified': datetime.datetime(2024, 1, 18, 19, 56, 25), 'rev': '60f3dc22daeef0f9d7ed4', 'size': 5, 'media_info': None, 'symlink_info': None, 'sharing_info': None, 'is_downloadable': True, 'export_info': None, 'property_groups': None, 'has_explicit_shared_members': None, 'content_hash': '9595c9df90075148eb06860365df33584b75bff782a510c6cd4883a419833d50', 'file_lock_info': None, 'name': '/Data/test_dropbox/text1.txt', 'type': 'file'}\n", |
| 350 | + "{'id': 'id:pgKT2sXX3sMAAAAAAAAJRw', 'client_modified': datetime.datetime(2024, 1, 18, 19, 56, 29), 'server_modified': datetime.datetime(2024, 1, 18, 19, 56, 30), 'rev': '60f3dc2770bfd0f9d7ed4', 'size': 5, 'media_info': None, 'symlink_info': None, 'sharing_info': None, 'is_downloadable': True, 'export_info': None, 'property_groups': None, 'has_explicit_shared_members': None, 'content_hash': '70bc18bef5ae66b72d1995f8db90a583a60d77b4066e4653f1cead613025861c', 'file_lock_info': None, 'name': '/Data/test_dropbox/test.txt', 'type': 'file'}\n", |
| 351 | + "{'id': 'id:pgKT2sXX3sMAAAAAAAAJSA', 'client_modified': datetime.datetime(2024, 1, 18, 19, 56, 31), 'server_modified': datetime.datetime(2024, 1, 18, 19, 56, 31), 'rev': '60f3dc28b1a6f0f9d7ed4', 'size': 5, 'media_info': None, 'symlink_info': None, 'sharing_info': None, 'is_downloadable': True, 'export_info': None, 'property_groups': None, 'has_explicit_shared_members': None, 'content_hash': '63e5c163c81ee9a3ed99d365ff963ecea340cc455deeac7c4b63ac75b9cf4706', 'file_lock_info': None, 'name': '/Data/test_dropbox/test (1).txt', 'type': 'file'}\n", |
391 | 352 | "\n", |
392 | 353 | "Available info for folder type:\n", |
393 | 354 | "['id', 'shared_folder_id', 'sharing_info', 'property_groups', 'name', 'size', 'type']\n", |
|
411 | 372 | }, |
412 | 373 | { |
413 | 374 | "cell_type": "code", |
414 | | - "execution_count": 17, |
| 375 | + "execution_count": 15, |
415 | 376 | "metadata": { |
416 | 377 | "tags": [] |
417 | 378 | }, |
|
442 | 403 | }, |
443 | 404 | { |
444 | 405 | "cell_type": "code", |
445 | | - "execution_count": 18, |
| 406 | + "execution_count": 16, |
446 | 407 | "metadata": {}, |
447 | 408 | "outputs": [ |
448 | 409 | { |
|
472 | 433 | " print(item)" |
473 | 434 | ] |
474 | 435 | }, |
| 436 | + { |
| 437 | + "cell_type": "markdown", |
| 438 | + "metadata": {}, |
| 439 | + "source": [ |
| 440 | + "## Read with intake\n", |
| 441 | + "\n", |
| 442 | + "Note that the path used has three ///: The path needs to be dropbox:// + /folder1/folder2 \n", |
| 443 | + "\n", |
| 444 | + "Without it, the dropbox sdk used in background will take as cloud path : /folder2 instead of /folder1/folder2" |
| 445 | + ] |
| 446 | + }, |
| 447 | + { |
| 448 | + "cell_type": "code", |
| 449 | + "execution_count": 17, |
| 450 | + "metadata": { |
| 451 | + "tags": [] |
| 452 | + }, |
| 453 | + "outputs": [], |
| 454 | + "source": [ |
| 455 | + "import intake" |
| 456 | + ] |
| 457 | + }, |
| 458 | + { |
| 459 | + "cell_type": "code", |
| 460 | + "execution_count": 18, |
| 461 | + "metadata": {}, |
| 462 | + "outputs": [], |
| 463 | + "source": [ |
| 464 | + "file_intake = intake.open_textfiles(\"dropbox:///Data/test_dropbox/test.txt\",storage_options={\"token\":token})\n" |
| 465 | + ] |
| 466 | + }, |
475 | 467 | { |
476 | 468 | "cell_type": "code", |
477 | 469 | "execution_count": 19, |
478 | 470 | "metadata": {}, |
| 471 | + "outputs": [ |
| 472 | + { |
| 473 | + "data": { |
| 474 | + "text/plain": [ |
| 475 | + "['Hello']" |
| 476 | + ] |
| 477 | + }, |
| 478 | + "execution_count": 19, |
| 479 | + "metadata": {}, |
| 480 | + "output_type": "execute_result" |
| 481 | + } |
| 482 | + ], |
| 483 | + "source": [ |
| 484 | + "file_intake.read()" |
| 485 | + ] |
| 486 | + }, |
| 487 | + { |
| 488 | + "cell_type": "markdown", |
| 489 | + "metadata": {}, |
| 490 | + "source": [ |
| 491 | + "## Clean up online and in local" |
| 492 | + ] |
| 493 | + }, |
| 494 | + { |
| 495 | + "cell_type": "code", |
| 496 | + "execution_count": 20, |
| 497 | + "metadata": {}, |
479 | 498 | "outputs": [ |
480 | 499 | { |
481 | 500 | "name": "stderr", |
|
0 commit comments