NGPIris 5.2.3.dev2__tar.gz → 5.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris/hcp/hcp.py +68 -22
  2. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1/NGPIris.egg-info}/PKG-INFO +1 -1
  3. ngpiris-5.3.1/NGPIris.egg-info/SOURCES.txt +52 -0
  4. {ngpiris-5.2.3.dev2/NGPIris.egg-info → ngpiris-5.3.1}/PKG-INFO +1 -1
  5. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/docs/conf.py +1 -1
  6. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/docs/index.rst +1 -1
  7. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/pyproject.toml +1 -1
  8. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/tests/test_hcp.py +36 -12
  9. ngpiris-5.2.3.dev2/NGPIris.egg-info/SOURCES.txt +0 -128
  10. ngpiris-5.2.3.dev2/docs/_build/.DS_Store +0 -0
  11. ngpiris-5.2.3.dev2/docs/_build/doctrees/IRIS_5_changelog.doctree +0 -0
  12. ngpiris-5.2.3.dev2/docs/_build/doctrees/NGPIris.cli.doctree +0 -0
  13. ngpiris-5.2.3.dev2/docs/_build/doctrees/NGPIris.doctree +0 -0
  14. ngpiris-5.2.3.dev2/docs/_build/doctrees/NGPIris.hci.doctree +0 -0
  15. ngpiris-5.2.3.dev2/docs/_build/doctrees/NGPIris.hcp.doctree +0 -0
  16. ngpiris-5.2.3.dev2/docs/_build/doctrees/NGPIris.parse_credentials.doctree +0 -0
  17. ngpiris-5.2.3.dev2/docs/_build/doctrees/NGPIris.utils.doctree +0 -0
  18. ngpiris-5.2.3.dev2/docs/_build/doctrees/README.doctree +0 -0
  19. ngpiris-5.2.3.dev2/docs/_build/doctrees/Tutorial.doctree +0 -0
  20. ngpiris-5.2.3.dev2/docs/_build/doctrees/environment.pickle +0 -0
  21. ngpiris-5.2.3.dev2/docs/_build/doctrees/index.doctree +0 -0
  22. ngpiris-5.2.3.dev2/docs/_build/doctrees/modules.doctree +0 -0
  23. ngpiris-5.2.3.dev2/docs/_build/html/.buildinfo +0 -4
  24. ngpiris-5.2.3.dev2/docs/_build/html/IRIS_5_changelog.html +0 -462
  25. ngpiris-5.2.3.dev2/docs/_build/html/NGPIris.cli.html +0 -137
  26. ngpiris-5.2.3.dev2/docs/_build/html/NGPIris.hci.html +0 -280
  27. ngpiris-5.2.3.dev2/docs/_build/html/NGPIris.hcp.html +0 -357
  28. ngpiris-5.2.3.dev2/docs/_build/html/NGPIris.html +0 -236
  29. ngpiris-5.2.3.dev2/docs/_build/html/NGPIris.parse_credentials.html +0 -156
  30. ngpiris-5.2.3.dev2/docs/_build/html/NGPIris.utils.html +0 -143
  31. ngpiris-5.2.3.dev2/docs/_build/html/README.html +0 -681
  32. ngpiris-5.2.3.dev2/docs/_build/html/Tutorial.html +0 -796
  33. ngpiris-5.2.3.dev2/docs/_build/html/_downloads/ee00c4f6f22dc2671c766f728f00006f/credentials_template.json +0 -14
  34. ngpiris-5.2.3.dev2/docs/_build/html/_modules/NGPIris/cli.html +0 -338
  35. ngpiris-5.2.3.dev2/docs/_build/html/_modules/NGPIris/hci/exceptions.html +0 -106
  36. ngpiris-5.2.3.dev2/docs/_build/html/_modules/NGPIris/hci/hci.html +0 -250
  37. ngpiris-5.2.3.dev2/docs/_build/html/_modules/NGPIris/hci/helpers.html +0 -204
  38. ngpiris-5.2.3.dev2/docs/_build/html/_modules/NGPIris/hcp/exceptions.html +0 -117
  39. ngpiris-5.2.3.dev2/docs/_build/html/_modules/NGPIris/hcp/hcp.html +0 -655
  40. ngpiris-5.2.3.dev2/docs/_build/html/_modules/NGPIris/hcp/helpers.html +0 -148
  41. ngpiris-5.2.3.dev2/docs/_build/html/_modules/NGPIris/hcp/statistics.html +0 -137
  42. ngpiris-5.2.3.dev2/docs/_build/html/_modules/NGPIris/parse_credentials/parse_credentials.html +0 -170
  43. ngpiris-5.2.3.dev2/docs/_build/html/_modules/NGPIris/utils/utils.html +0 -115
  44. ngpiris-5.2.3.dev2/docs/_build/html/_modules/index.html +0 -108
  45. ngpiris-5.2.3.dev2/docs/_build/html/_sources/IRIS_5_changelog.md.txt +0 -43
  46. ngpiris-5.2.3.dev2/docs/_build/html/_sources/NGPIris.cli.rst.txt +0 -10
  47. ngpiris-5.2.3.dev2/docs/_build/html/_sources/NGPIris.hci.rst.txt +0 -37
  48. ngpiris-5.2.3.dev2/docs/_build/html/_sources/NGPIris.hcp.rst.txt +0 -45
  49. ngpiris-5.2.3.dev2/docs/_build/html/_sources/NGPIris.parse_credentials.rst.txt +0 -21
  50. ngpiris-5.2.3.dev2/docs/_build/html/_sources/NGPIris.rst.txt +0 -22
  51. ngpiris-5.2.3.dev2/docs/_build/html/_sources/NGPIris.utils.rst.txt +0 -21
  52. ngpiris-5.2.3.dev2/docs/_build/html/_sources/README.md.txt +0 -274
  53. ngpiris-5.2.3.dev2/docs/_build/html/_sources/Tutorial.md.txt +0 -326
  54. ngpiris-5.2.3.dev2/docs/_build/html/_sources/index.rst.txt +0 -21
  55. ngpiris-5.2.3.dev2/docs/_build/html/_sources/modules.rst.txt +0 -7
  56. ngpiris-5.2.3.dev2/docs/_build/html/_static/alabaster.css +0 -708
  57. ngpiris-5.2.3.dev2/docs/_build/html/_static/basic.css +0 -925
  58. ngpiris-5.2.3.dev2/docs/_build/html/_static/custom.css +0 -1
  59. ngpiris-5.2.3.dev2/docs/_build/html/_static/debug.css +0 -69
  60. ngpiris-5.2.3.dev2/docs/_build/html/_static/doctools.js +0 -156
  61. ngpiris-5.2.3.dev2/docs/_build/html/_static/documentation_options.js +0 -13
  62. ngpiris-5.2.3.dev2/docs/_build/html/_static/file.png +0 -0
  63. ngpiris-5.2.3.dev2/docs/_build/html/_static/language_data.js +0 -199
  64. ngpiris-5.2.3.dev2/docs/_build/html/_static/minus.png +0 -0
  65. ngpiris-5.2.3.dev2/docs/_build/html/_static/plus.png +0 -0
  66. ngpiris-5.2.3.dev2/docs/_build/html/_static/pygments.css +0 -83
  67. ngpiris-5.2.3.dev2/docs/_build/html/_static/scripts/furo-extensions.js +0 -0
  68. ngpiris-5.2.3.dev2/docs/_build/html/_static/scripts/furo.js +0 -3
  69. ngpiris-5.2.3.dev2/docs/_build/html/_static/scripts/furo.js.LICENSE.txt +0 -7
  70. ngpiris-5.2.3.dev2/docs/_build/html/_static/scripts/furo.js.map +0 -1
  71. ngpiris-5.2.3.dev2/docs/_build/html/_static/searchtools.js +0 -619
  72. ngpiris-5.2.3.dev2/docs/_build/html/_static/skeleton.css +0 -296
  73. ngpiris-5.2.3.dev2/docs/_build/html/_static/sphinx_highlight.js +0 -154
  74. ngpiris-5.2.3.dev2/docs/_build/html/_static/styles/furo-extensions.css +0 -2
  75. ngpiris-5.2.3.dev2/docs/_build/html/_static/styles/furo-extensions.css.map +0 -1
  76. ngpiris-5.2.3.dev2/docs/_build/html/_static/styles/furo.css +0 -2
  77. ngpiris-5.2.3.dev2/docs/_build/html/_static/styles/furo.css.map +0 -1
  78. ngpiris-5.2.3.dev2/docs/_build/html/genindex.html +0 -476
  79. ngpiris-5.2.3.dev2/docs/_build/html/index.html +0 -159
  80. ngpiris-5.2.3.dev2/docs/_build/html/modules.html +0 -148
  81. ngpiris-5.2.3.dev2/docs/_build/html/objects.inv +0 -0
  82. ngpiris-5.2.3.dev2/docs/_build/html/py-modindex.html +0 -188
  83. ngpiris-5.2.3.dev2/docs/_build/html/search.html +0 -120
  84. ngpiris-5.2.3.dev2/docs/_build/html/searchindex.js +0 -1
  85. ngpiris-5.2.3.dev2/tests/data/.DS_Store +0 -0
  86. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/LICENSE +0 -0
  87. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/MANIFEST.in +0 -0
  88. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris/__init__.py +0 -0
  89. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris/cli/__init__.py +0 -0
  90. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris/hci/__init__.py +0 -0
  91. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris/hci/exceptions.py +0 -0
  92. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris/hci/hci.py +0 -0
  93. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris/hci/helpers.py +0 -0
  94. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris/hcp/__init__.py +0 -0
  95. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris/hcp/exceptions.py +0 -0
  96. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris/hcp/helpers.py +0 -0
  97. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris/hcp/statistics.py +0 -0
  98. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris/parse_credentials/__init__.py +0 -0
  99. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris/parse_credentials/parse_credentials.py +0 -0
  100. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris/utils/__init__.py +0 -0
  101. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris/utils/utils.py +0 -0
  102. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris.egg-info/dependency_links.txt +0 -0
  103. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris.egg-info/entry_points.txt +0 -0
  104. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris.egg-info/requires.txt +0 -0
  105. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/NGPIris.egg-info/top_level.txt +0 -0
  106. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/README.md +0 -0
  107. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/docs/IRIS_5_changelog.md +0 -0
  108. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/docs/Makefile +0 -0
  109. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/docs/NGPIris.cli.rst +0 -0
  110. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/docs/NGPIris.hci.rst +0 -0
  111. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/docs/NGPIris.hcp.rst +0 -0
  112. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/docs/NGPIris.parse_credentials.rst +0 -0
  113. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/docs/NGPIris.rst +0 -0
  114. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/docs/NGPIris.utils.rst +0 -0
  115. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/docs/Tutorial.md +0 -0
  116. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/docs/make.bat +0 -0
  117. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/docs/modules.rst +0 -0
  118. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/setup.cfg +0 -0
  119. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/tests/data/80MB_test_file +0 -0
  120. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/tests/data/a folder of data/80MB_test_file_0 +0 -0
  121. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/tests/data/a folder of data/80MB_test_file_1 +0 -0
  122. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/tests/data/complete_creds_0.json +0 -0
  123. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/tests/data/complete_creds_1.json +0 -0
  124. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/tests/data/complete_creds_2.json +0 -0
  125. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/tests/data/incomplete_creds_0.json +0 -0
  126. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/tests/data/incomplete_creds_1.json +0 -0
  127. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/tests/data/incomplete_creds_2.json +0 -0
  128. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/tests/data/incomplete_creds_3.json +0 -0
  129. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/tests/data/incomplete_creds_4.json +0 -0
  130. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/tests/test_hci.py +0 -0
  131. {ngpiris-5.2.3.dev2 → ngpiris-5.3.1}/tests/test_parse_credentials.py +0 -0
@@ -340,7 +340,7 @@ class HCPHandler:
340
340
  return False
341
341
 
342
342
  @check_mounted
343
- def download_file(self, key : str, local_file_path : str) -> None:
343
+ def download_file(self, key : str, local_file_path : str, show_progress_bar : bool = True) -> None:
344
344
  """
345
345
  Download one object file from the mounted bucket
346
346
 
@@ -349,25 +349,38 @@ class HCPHandler:
349
349
 
350
350
  :param local_file_path: Path to a file on your local system where the contents of the object file can be put
351
351
  :type local_file_path: str
352
+
353
+ :param show_progress_bar: Boolean choice of displaying a progress bar. Defaults to True
354
+ :type show_progress_bar: bool, optional
355
+
356
+ :raises ObjectDoesNotExist: If the object does not exist in the bucket
352
357
  """
353
358
  try:
354
359
  self.get_object(key)
355
360
  except:
356
361
  raise ObjectDoesNotExist("Could not find object", "\"" + key + "\"", "in bucket", "\"" + str(self.bucket_name) + "\"")
357
362
  try:
358
- file_size : int = self.s3_client.head_object(Bucket = self.bucket_name, Key = key)["ContentLength"]
359
- with tqdm(
360
- total = file_size,
361
- unit = "B",
362
- unit_scale = True,
363
- desc = key
364
- ) as pbar:
363
+ if show_progress_bar:
364
+ file_size : int = self.s3_client.head_object(Bucket = self.bucket_name, Key = key)["ContentLength"]
365
+ with tqdm(
366
+ total = file_size,
367
+ unit = "B",
368
+ unit_scale = True,
369
+ desc = key
370
+ ) as pbar:
371
+ self.s3_client.download_file(
372
+ Bucket = self.bucket_name,
373
+ Key = key,
374
+ Filename = local_file_path,
375
+ Config = self.transfer_config,
376
+ Callback = lambda bytes_transferred : pbar.update(bytes_transferred)
377
+ )
378
+ else:
365
379
  self.s3_client.download_file(
366
380
  Bucket = self.bucket_name,
367
381
  Key = key,
368
382
  Filename = local_file_path,
369
383
  Config = self.transfer_config,
370
- Callback = lambda bytes_transferred : pbar.update(bytes_transferred)
371
384
  )
372
385
  except ClientError as e0:
373
386
  print(str(e0))
@@ -376,7 +389,14 @@ class HCPHandler:
376
389
  raise Exception(e)
377
390
 
378
391
  @check_mounted
379
- def download_folder(self, folder_key : str, local_folder_path : str, use_download_limit : bool = False, download_limit_in_bytes : Byte = TiB(1).to_Byte()) -> None:
392
+ def download_folder(
393
+ self,
394
+ folder_key : str,
395
+ local_folder_path : str,
396
+ use_download_limit : bool = False,
397
+ download_limit_in_bytes : Byte = TiB(1).to_Byte(),
398
+ show_progress_bar : bool = True
399
+ ) -> None:
380
400
  """
381
401
  Download multiple objects from a folder in the mounted bucket
382
402
 
@@ -392,7 +412,13 @@ class HCPHandler:
392
412
  :param download_limit_in_bytes: The optional download limit in Byte (from the package `bitmath`). Defaults to 1 TB (`TiB(1).to_Byte()`)
393
413
  :type download_limit_in_bytes: Byte, optional
394
414
 
415
+ :param show_progress_bar: Boolean choice of displaying a progress bar. Defaults to True
416
+ :type show_progress_bar: bool, optional
417
+
418
+ :raises ObjectDoesNotExist: If the object does not exist in the bucket
419
+
395
420
  :raises DownloadLimitReached: If download limit was reached while downloading files
421
+
396
422
  :raises NotADirectory: If local_folder_path is not a directory
397
423
  """
398
424
  try:
@@ -409,12 +435,12 @@ class HCPHandler:
409
435
  current_download_size_in_bytes += Byte(object["Size"])
410
436
  if current_download_size_in_bytes >= download_limit_in_bytes and use_download_limit:
411
437
  raise DownloadLimitReached("The download limit was reached when downloading files")
412
- self.download_file(object["Key"], p.as_posix())
438
+ self.download_file(object["Key"], p.as_posix(), show_progress_bar = show_progress_bar)
413
439
  else:
414
440
  raise NotADirectory(local_folder_path + " is not a directory")
415
441
 
416
442
  @check_mounted
417
- def upload_file(self, local_file_path : str, key : str = "") -> None:
443
+ def upload_file(self, local_file_path : str, key : str = "", show_progress_bar : bool = True) -> None:
418
444
  """
419
445
  Upload one file to the mounted bucket
420
446
 
@@ -423,6 +449,13 @@ class HCPHandler:
423
449
 
424
450
  :param key: An optional new name for the file object on the bucket. Defaults to the same name as the file
425
451
  :type key: str, optional
452
+
453
+ :param show_progress_bar: Boolean choice of displaying a progress bar. Defaults to True
454
+ :type show_progress_bar: bool, optional
455
+
456
+ :raises RuntimeError: If the \"\\\" is used in the file path
457
+
458
+ :raises ObjectAlreadyExist: If the object already exist on the mounted bucket
426
459
  """
427
460
  raise_path_error(local_file_path)
428
461
 
@@ -436,30 +469,43 @@ class HCPHandler:
436
469
  if self.object_exists(key):
437
470
  raise ObjectAlreadyExist("The object \"" + key + "\" already exist in the mounted bucket")
438
471
  else:
439
- file_size : int = stat(local_file_path).st_size
440
- with tqdm(
441
- total = file_size,
442
- unit = "B",
443
- unit_scale = True,
444
- desc = local_file_path
445
- ) as pbar:
472
+ if show_progress_bar:
473
+ file_size : int = stat(local_file_path).st_size
474
+ with tqdm(
475
+ total = file_size,
476
+ unit = "B",
477
+ unit_scale = True,
478
+ desc = local_file_path
479
+ ) as pbar:
480
+ self.s3_client.upload_file(
481
+ Filename = local_file_path,
482
+ Bucket = self.bucket_name,
483
+ Key = key,
484
+ Config = self.transfer_config,
485
+ Callback = lambda bytes_transferred : pbar.update(bytes_transferred)
486
+ )
487
+ else:
446
488
  self.s3_client.upload_file(
447
489
  Filename = local_file_path,
448
490
  Bucket = self.bucket_name,
449
491
  Key = key,
450
492
  Config = self.transfer_config,
451
- Callback = lambda bytes_transferred : pbar.update(bytes_transferred)
452
493
  )
453
494
 
495
+
454
496
  @check_mounted
455
- def upload_folder(self, local_folder_path : str, key : str = "") -> None:
497
+ def upload_folder(self, local_folder_path : str, key : str = "", show_progress_bar : bool = True) -> None:
456
498
  """
457
499
  Upload the contents of a folder to the mounted bucket
458
500
 
459
501
  :param local_folder_path: Path to the folder to be uploaded
460
502
  :type local_folder_path: str
503
+
461
504
  :param key: An optional new name for the folder path on the bucket. Defaults to the same name as the local folder path
462
505
  :type key: str, optional
506
+
507
+ :param show_progress_bar: Boolean choice of displaying a progress bar. Defaults to True
508
+ :type show_progress_bar: bool, optional
463
509
  """
464
510
  raise_path_error(local_folder_path)
465
511
 
@@ -468,7 +514,7 @@ class HCPHandler:
468
514
  filenames = listdir(local_folder_path)
469
515
 
470
516
  for filename in filenames:
471
- self.upload_file(local_folder_path + filename, key + filename)
517
+ self.upload_file(local_folder_path + filename, key + filename, show_progress_bar = show_progress_bar)
472
518
 
473
519
  @check_mounted
474
520
  def delete_objects(self, keys : list[str], verbose : bool = True) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: NGPIris
3
- Version: 5.2.3.dev2
3
+ Version: 5.3.1
4
4
  Author-email: Erik Brink <erik.brink@gu.se>, Isak Sylvin <isak.sylvin@gu.se>
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -0,0 +1,52 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ NGPIris/__init__.py
6
+ NGPIris.egg-info/PKG-INFO
7
+ NGPIris.egg-info/SOURCES.txt
8
+ NGPIris.egg-info/dependency_links.txt
9
+ NGPIris.egg-info/entry_points.txt
10
+ NGPIris.egg-info/requires.txt
11
+ NGPIris.egg-info/top_level.txt
12
+ NGPIris/cli/__init__.py
13
+ NGPIris/hci/__init__.py
14
+ NGPIris/hci/exceptions.py
15
+ NGPIris/hci/hci.py
16
+ NGPIris/hci/helpers.py
17
+ NGPIris/hcp/__init__.py
18
+ NGPIris/hcp/exceptions.py
19
+ NGPIris/hcp/hcp.py
20
+ NGPIris/hcp/helpers.py
21
+ NGPIris/hcp/statistics.py
22
+ NGPIris/parse_credentials/__init__.py
23
+ NGPIris/parse_credentials/parse_credentials.py
24
+ NGPIris/utils/__init__.py
25
+ NGPIris/utils/utils.py
26
+ docs/IRIS_5_changelog.md
27
+ docs/Makefile
28
+ docs/NGPIris.cli.rst
29
+ docs/NGPIris.hci.rst
30
+ docs/NGPIris.hcp.rst
31
+ docs/NGPIris.parse_credentials.rst
32
+ docs/NGPIris.rst
33
+ docs/NGPIris.utils.rst
34
+ docs/Tutorial.md
35
+ docs/conf.py
36
+ docs/index.rst
37
+ docs/make.bat
38
+ docs/modules.rst
39
+ tests/test_hci.py
40
+ tests/test_hcp.py
41
+ tests/test_parse_credentials.py
42
+ tests/data/80MB_test_file
43
+ tests/data/complete_creds_0.json
44
+ tests/data/complete_creds_1.json
45
+ tests/data/complete_creds_2.json
46
+ tests/data/incomplete_creds_0.json
47
+ tests/data/incomplete_creds_1.json
48
+ tests/data/incomplete_creds_2.json
49
+ tests/data/incomplete_creds_3.json
50
+ tests/data/incomplete_creds_4.json
51
+ tests/data/a folder of data/80MB_test_file_0
52
+ tests/data/a folder of data/80MB_test_file_1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: NGPIris
3
- Version: 5.2.3.dev2
3
+ Version: 5.3.1
4
4
  Author-email: Erik Brink <erik.brink@gu.se>, Isak Sylvin <isak.sylvin@gu.se>
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -7,7 +7,7 @@
7
7
  # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8
8
 
9
9
  project = 'NGPIris'
10
- copyright = '2024, Author'
10
+ copyright = '2025, Author'
11
11
  author = 'Author'
12
12
 
13
13
  # -- General configuration ---------------------------------------------------
@@ -1,5 +1,5 @@
1
1
  .. NGPIris documentation master file, created by
2
- sphinx-quickstart on Fri Sep 27 16:07:28 2024.
2
+ sphinx-quickstart on Fri Feb 14 09:54:45 2025.
3
3
  You can adapt this file completely to your liking, but it should at least
4
4
  contain the root `toctree` directive.
5
5
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "NGPIris"
3
- version = "5.2.3.dev2"
3
+ version = "5.3.1"
4
4
  readme = "README.md"
5
5
  dependencies = [
6
6
  "requests >= 2.31.0",
@@ -56,7 +56,19 @@ def test_list_objects_without_mounting(custom_config : CustomConfig) -> None:
56
56
 
57
57
  def test_upload_file(custom_config : CustomConfig) -> None:
58
58
  test_mount_bucket(custom_config)
59
- custom_config.hcp_h.upload_file(custom_config.test_file_path)
59
+
60
+ # With progress bar
61
+ custom_config.hcp_h.upload_file(
62
+ custom_config.test_file_path,
63
+ custom_config.test_file_path
64
+ )
65
+
66
+ # Without progress bar
67
+ custom_config.hcp_h.upload_file(
68
+ custom_config.test_file_path,
69
+ custom_config.test_file_path + "_no_progress_bar",
70
+ show_progress_bar = False
71
+ )
60
72
 
61
73
  def test_upload_file_without_mounting(custom_config : CustomConfig) -> None:
62
74
  _hcp_h = custom_config.hcp_h
@@ -104,16 +116,29 @@ def test_get_folder_without_mounting(custom_config : CustomConfig) -> None:
104
116
 
105
117
  def test_get_file_in_sub_directory(custom_config : CustomConfig) -> None:
106
118
  test_mount_bucket(custom_config)
107
- test_file = Path(custom_config.test_file_path).name
108
- assert custom_config.hcp_h.object_exists(test_file)
109
- assert custom_config.hcp_h.get_object(test_file)
119
+ assert custom_config.hcp_h.object_exists(custom_config.test_file_path)
120
+ assert custom_config.hcp_h.get_object(custom_config.test_file_path)
121
+
122
+ from icecream import ic
110
123
 
111
124
  def test_download_file(custom_config : CustomConfig) -> None:
112
125
  test_mount_bucket(custom_config)
113
- Path(custom_config.result_path).mkdir()
114
- test_file = Path(custom_config.test_file_path).name
115
- custom_config.hcp_h.download_file(test_file, custom_config.result_path + test_file)
116
- assert cmp(custom_config.result_path + test_file, custom_config.test_file_path)
126
+ Path(custom_config.result_path).mkdir()
127
+
128
+ test_folder_path = str(custom_config.test_file_path).rsplit("/", maxsplit = 1)[0] + "/"
129
+ Path(custom_config.result_path + test_folder_path).mkdir(parents = True, exist_ok = True)
130
+
131
+ # With progress bar
132
+ custom_config.hcp_h.download_file(custom_config.test_file_path, custom_config.result_path + custom_config.test_file_path)
133
+ assert cmp(custom_config.result_path + custom_config.test_file_path, custom_config.test_file_path)
134
+
135
+ # Without progress bar
136
+ custom_config.hcp_h.download_file(
137
+ custom_config.test_file_path + "_no_progress_bar",
138
+ custom_config.result_path + custom_config.test_file_path + "_no_progress_bar",
139
+ show_progress_bar = False
140
+ )
141
+ assert cmp(custom_config.result_path + custom_config.test_file_path, custom_config.test_file_path)
117
142
 
118
143
  def test_download_file_without_mounting(custom_config : CustomConfig) -> None:
119
144
  _hcp_h = custom_config.hcp_h
@@ -152,8 +177,7 @@ def test_fuzzy_search_in_bucket_without_mounting(custom_config : CustomConfig) -
152
177
 
153
178
  def test_get_object_acl(custom_config : CustomConfig) -> None:
154
179
  test_mount_bucket(custom_config)
155
- test_file = Path(custom_config.test_file_path).name
156
- custom_config.hcp_h.get_object_acl(test_file)
180
+ custom_config.hcp_h.get_object_acl(custom_config.test_file_path)
157
181
 
158
182
  def test_get_object_acl_without_mounting(custom_config : CustomConfig) -> None:
159
183
  _hcp_h = custom_config.hcp_h
@@ -189,8 +213,8 @@ def test_get_bucket_acl_without_mounting(custom_config : CustomConfig) -> None:
189
213
 
190
214
  def test_delete_file(custom_config : CustomConfig) -> None:
191
215
  test_mount_bucket(custom_config)
192
- test_file = Path(custom_config.test_file_path).name
193
- custom_config.hcp_h.delete_object(test_file)
216
+ custom_config.hcp_h.delete_object(custom_config.test_file_path)
217
+ custom_config.hcp_h.delete_object(custom_config.test_file_path + "_no_progress_bar")
194
218
  custom_config.hcp_h.delete_object("a_sub_directory/a_file")
195
219
  custom_config.hcp_h.delete_object("a_sub_directory")
196
220
 
@@ -1,128 +0,0 @@
1
- LICENSE
2
- MANIFEST.in
3
- README.md
4
- pyproject.toml
5
- NGPIris/__init__.py
6
- NGPIris.egg-info/PKG-INFO
7
- NGPIris.egg-info/SOURCES.txt
8
- NGPIris.egg-info/dependency_links.txt
9
- NGPIris.egg-info/entry_points.txt
10
- NGPIris.egg-info/requires.txt
11
- NGPIris.egg-info/top_level.txt
12
- NGPIris/cli/__init__.py
13
- NGPIris/hci/__init__.py
14
- NGPIris/hci/exceptions.py
15
- NGPIris/hci/hci.py
16
- NGPIris/hci/helpers.py
17
- NGPIris/hcp/__init__.py
18
- NGPIris/hcp/exceptions.py
19
- NGPIris/hcp/hcp.py
20
- NGPIris/hcp/helpers.py
21
- NGPIris/hcp/statistics.py
22
- NGPIris/parse_credentials/__init__.py
23
- NGPIris/parse_credentials/parse_credentials.py
24
- NGPIris/utils/__init__.py
25
- NGPIris/utils/utils.py
26
- docs/IRIS_5_changelog.md
27
- docs/Makefile
28
- docs/NGPIris.cli.rst
29
- docs/NGPIris.hci.rst
30
- docs/NGPIris.hcp.rst
31
- docs/NGPIris.parse_credentials.rst
32
- docs/NGPIris.rst
33
- docs/NGPIris.utils.rst
34
- docs/Tutorial.md
35
- docs/conf.py
36
- docs/index.rst
37
- docs/make.bat
38
- docs/modules.rst
39
- docs/_build/.DS_Store
40
- docs/_build/doctrees/IRIS_5_changelog.doctree
41
- docs/_build/doctrees/NGPIris.cli.doctree
42
- docs/_build/doctrees/NGPIris.doctree
43
- docs/_build/doctrees/NGPIris.hci.doctree
44
- docs/_build/doctrees/NGPIris.hcp.doctree
45
- docs/_build/doctrees/NGPIris.parse_credentials.doctree
46
- docs/_build/doctrees/NGPIris.utils.doctree
47
- docs/_build/doctrees/README.doctree
48
- docs/_build/doctrees/Tutorial.doctree
49
- docs/_build/doctrees/environment.pickle
50
- docs/_build/doctrees/index.doctree
51
- docs/_build/doctrees/modules.doctree
52
- docs/_build/html/.buildinfo
53
- docs/_build/html/IRIS_5_changelog.html
54
- docs/_build/html/NGPIris.cli.html
55
- docs/_build/html/NGPIris.hci.html
56
- docs/_build/html/NGPIris.hcp.html
57
- docs/_build/html/NGPIris.html
58
- docs/_build/html/NGPIris.parse_credentials.html
59
- docs/_build/html/NGPIris.utils.html
60
- docs/_build/html/README.html
61
- docs/_build/html/Tutorial.html
62
- docs/_build/html/genindex.html
63
- docs/_build/html/index.html
64
- docs/_build/html/modules.html
65
- docs/_build/html/objects.inv
66
- docs/_build/html/py-modindex.html
67
- docs/_build/html/search.html
68
- docs/_build/html/searchindex.js
69
- docs/_build/html/_downloads/ee00c4f6f22dc2671c766f728f00006f/credentials_template.json
70
- docs/_build/html/_modules/index.html
71
- docs/_build/html/_modules/NGPIris/cli.html
72
- docs/_build/html/_modules/NGPIris/hci/exceptions.html
73
- docs/_build/html/_modules/NGPIris/hci/hci.html
74
- docs/_build/html/_modules/NGPIris/hci/helpers.html
75
- docs/_build/html/_modules/NGPIris/hcp/exceptions.html
76
- docs/_build/html/_modules/NGPIris/hcp/hcp.html
77
- docs/_build/html/_modules/NGPIris/hcp/helpers.html
78
- docs/_build/html/_modules/NGPIris/hcp/statistics.html
79
- docs/_build/html/_modules/NGPIris/parse_credentials/parse_credentials.html
80
- docs/_build/html/_modules/NGPIris/utils/utils.html
81
- docs/_build/html/_sources/IRIS_5_changelog.md.txt
82
- docs/_build/html/_sources/NGPIris.cli.rst.txt
83
- docs/_build/html/_sources/NGPIris.hci.rst.txt
84
- docs/_build/html/_sources/NGPIris.hcp.rst.txt
85
- docs/_build/html/_sources/NGPIris.parse_credentials.rst.txt
86
- docs/_build/html/_sources/NGPIris.rst.txt
87
- docs/_build/html/_sources/NGPIris.utils.rst.txt
88
- docs/_build/html/_sources/README.md.txt
89
- docs/_build/html/_sources/Tutorial.md.txt
90
- docs/_build/html/_sources/index.rst.txt
91
- docs/_build/html/_sources/modules.rst.txt
92
- docs/_build/html/_static/alabaster.css
93
- docs/_build/html/_static/basic.css
94
- docs/_build/html/_static/custom.css
95
- docs/_build/html/_static/debug.css
96
- docs/_build/html/_static/doctools.js
97
- docs/_build/html/_static/documentation_options.js
98
- docs/_build/html/_static/file.png
99
- docs/_build/html/_static/language_data.js
100
- docs/_build/html/_static/minus.png
101
- docs/_build/html/_static/plus.png
102
- docs/_build/html/_static/pygments.css
103
- docs/_build/html/_static/searchtools.js
104
- docs/_build/html/_static/skeleton.css
105
- docs/_build/html/_static/sphinx_highlight.js
106
- docs/_build/html/_static/scripts/furo-extensions.js
107
- docs/_build/html/_static/scripts/furo.js
108
- docs/_build/html/_static/scripts/furo.js.LICENSE.txt
109
- docs/_build/html/_static/scripts/furo.js.map
110
- docs/_build/html/_static/styles/furo-extensions.css
111
- docs/_build/html/_static/styles/furo-extensions.css.map
112
- docs/_build/html/_static/styles/furo.css
113
- docs/_build/html/_static/styles/furo.css.map
114
- tests/test_hci.py
115
- tests/test_hcp.py
116
- tests/test_parse_credentials.py
117
- tests/data/.DS_Store
118
- tests/data/80MB_test_file
119
- tests/data/complete_creds_0.json
120
- tests/data/complete_creds_1.json
121
- tests/data/complete_creds_2.json
122
- tests/data/incomplete_creds_0.json
123
- tests/data/incomplete_creds_1.json
124
- tests/data/incomplete_creds_2.json
125
- tests/data/incomplete_creds_3.json
126
- tests/data/incomplete_creds_4.json
127
- tests/data/a folder of data/80MB_test_file_0
128
- tests/data/a folder of data/80MB_test_file_1
Binary file
@@ -1,4 +0,0 @@
1
- # Sphinx build info version 1
2
- # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3
- config: d9c1d66de873cf4315be327a96406c4d
4
- tags: 645f666f9bcd5a90fca523b33c5a78b7