pyPreservica 2.1.2__py3-none-any.whl → 2.2.1__py3-none-any.whl

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.
pyPreservica/__init__.py CHANGED
@@ -23,6 +23,6 @@ from .authorityAPI import AuthorityAPI, Table
23
23
  __author__ = "James Carr (drjamescarr@gmail.com)"
24
24
 
25
25
  # Version of the Preservica API package
26
- __version__ = "2.1.2"
26
+ __version__ = "2.2.1"
27
27
 
28
28
  __license__ = "Apache License Version 2.0"
pyPreservica/entityAPI.py CHANGED
@@ -1708,7 +1708,7 @@ class EntityAPI(AuthenticatedAPI):
1708
1708
  if isinstance(entity, ContentObject):
1709
1709
  raise RuntimeError("Thumbnails cannot be added to Content Objects")
1710
1710
 
1711
- headers = {HEADER_TOKEN: self.token} # , 'Content-Type': 'application/octet-stream'}
1711
+ headers = {HEADER_TOKEN: self.token, 'Content-Type': 'application/octet-stream'}
1712
1712
 
1713
1713
  with open(image_file, 'rb') as fd:
1714
1714
  request = self.session.put(
pyPreservica/uploadAPI.py CHANGED
@@ -1065,9 +1065,6 @@ def complex_asset_package(preservation_files_list=None, access_files_list=None,
1065
1065
  content = SubElement(metadata, 'Content')
1066
1066
  content.append(descriptive_metadata.getroot())
1067
1067
 
1068
-
1069
-
1070
-
1071
1068
  if xip is not None:
1072
1069
  export_folder = export_folder
1073
1070
  top_level_folder = os.path.join(export_folder, io_ref)
@@ -1742,6 +1739,38 @@ class UploadAPI(AuthenticatedAPI):
1742
1739
  logger.info(f"Reached Max Upload Limit")
1743
1740
  break
1744
1741
 
1742
+ def upload_zip_to_Source(self, path_to_zip_package, container_name, folder=None, delete_after_upload=False,
1743
+ show_progress=False):
1744
+
1745
+ """
1746
+ Uploads a zip file package to either an Azure container or S3 bucket
1747
+ depending on the Preservica system deployment
1748
+
1749
+ :param str path_to_zip_package: Path to the package
1750
+ :param str container_name: container connected to the ingest workflow
1751
+ :param Folder folder: The folder to ingest the package into
1752
+ :param bool delete_after_upload: Delete the local copy of the package after the upload has completed
1753
+ :param bool show_progress: Show upload progress bar
1754
+
1755
+ """
1756
+
1757
+ locations = self.upload_locations()
1758
+ for location in locations:
1759
+ if location['containerName'] == container_name:
1760
+ if location['type'] == 'AWS':
1761
+ callback = None
1762
+ if show_progress:
1763
+ callback = UploadProgressConsoleCallback(path_to_zip_package)
1764
+ self.upload_zip_package_to_S3(path_to_zip_package=path_to_zip_package,
1765
+ bucket_name=container_name, folder=folder, callback=callback,
1766
+ delete_after_upload=delete_after_upload)
1767
+ else:
1768
+ self.upload_zip_package_to_Azure(path_to_zip_package=path_to_zip_package,
1769
+ container_name=container_name, folder=folder,
1770
+ delete_after_upload=delete_after_upload,
1771
+ show_progress=show_progress)
1772
+
1773
+
1745
1774
  def upload_zip_package_to_Azure(self, path_to_zip_package, container_name, folder=None, delete_after_upload=False,
1746
1775
  show_progress=False):
1747
1776
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyPreservica
3
- Version: 2.1.2
3
+ Version: 2.2.1
4
4
  Summary: Python library for the Preservica API
5
5
  Home-page: https://pypreservica.readthedocs.io/
6
6
  Author: James Carr
@@ -1,19 +1,19 @@
1
- pyPreservica/__init__.py,sha256=pru8_C8g8wtJBMlhJYHgqxk4VoFEPT-ixIfPxv2fPKs,1085
1
+ pyPreservica/__init__.py,sha256=3yJh4gowQZcH-bl9aXF3q3I_s6R_EQLcwWD919yt6zQ,1085
2
2
  pyPreservica/adminAPI.py,sha256=HoiNw1eWKhyb2Ccr40GjjMRjxMQIfoPIWP3h3pQjm0E,37810
3
3
  pyPreservica/authorityAPI.py,sha256=Eule8g6LXr8c8SFcJgpRah4lH1FgevUItO5HhHDEaZE,9172
4
4
  pyPreservica/common.py,sha256=kEfrJAr7cTNG37ziYUW-lgA8b2Llw3UGvfMxOoz-jyQ,35346
5
5
  pyPreservica/contentAPI.py,sha256=GZZsZYOf9uXQ7hdnvZldrQuXYrndkec21P-ACgn-Wus,17251
6
- pyPreservica/entityAPI.py,sha256=rUwAOvbXi3x8L0xatNRtZjMXdbs8bzyjU2XOqlSw3hA,108985
6
+ pyPreservica/entityAPI.py,sha256=FjMFudkJCw0xHv6X0i3C_GPZc4m6b4sUSo6UzljzvFs,108981
7
7
  pyPreservica/monitorAPI.py,sha256=Xto2uSiryfZlUMUCrH7it2B8xOPVSLgSVLodxZW45po,6258
8
8
  pyPreservica/opex.py,sha256=ccra1S4ojUXS3PlbU8WfxajOkJrwG4OykBnNrYP_jus,4875
9
9
  pyPreservica/parAPI.py,sha256=bgaQvYfWNnzdD7ibKMV3ZV85pNkEdSoLsgVigoiFFfw,10771
10
10
  pyPreservica/retentionAPI.py,sha256=Cx1ofz9V31a8c8utEfKYLlfQaHSaaqg_D4R3LUFBEx0,23612
11
- pyPreservica/uploadAPI.py,sha256=82sM2iRXj0Nury_Ekn2NWYq-tPgIXq0b3hjVLVbnlrU,93366
11
+ pyPreservica/uploadAPI.py,sha256=HdMoQAq2PY6NQklrYb2l51YoPyTXc71__dXhqsuNP0A,95157
12
12
  pyPreservica/vocabularyAPI.py,sha256=jPl6KDZoBGqlY0oEYjTpZ9kNEPzchDW-gyp-HH-MSKk,5729
13
13
  pyPreservica/webHooksAPI.py,sha256=bhenk2nAlAZRauSET0AG9DZyKckJos2NENyl0LDN5Z4,6736
14
14
  pyPreservica/workflowAPI.py,sha256=QOMd4Nw69Vf8tJ7Px4gSLpug7VakAtNi-90UTgWSed0,17862
15
- pyPreservica-2.1.2.dist-info/LICENSE.txt,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
16
- pyPreservica-2.1.2.dist-info/METADATA,sha256=1XI-i_jc4HUafMz5dGw8tDW21DVN4JliXfSfQ_pBXJs,2784
17
- pyPreservica-2.1.2.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
18
- pyPreservica-2.1.2.dist-info/top_level.txt,sha256=iIBh6NAznYQHOV8mv_y_kGKSDITek9rANyFDwJsbU-c,13
19
- pyPreservica-2.1.2.dist-info/RECORD,,
15
+ pyPreservica-2.2.1.dist-info/LICENSE.txt,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
16
+ pyPreservica-2.2.1.dist-info/METADATA,sha256=xMTxeuB_6gMCiNZtir5ofjkKAF0zXAtJ5gnSHnxVXuU,2784
17
+ pyPreservica-2.2.1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
18
+ pyPreservica-2.2.1.dist-info/top_level.txt,sha256=iIBh6NAznYQHOV8mv_y_kGKSDITek9rANyFDwJsbU-c,13
19
+ pyPreservica-2.2.1.dist-info/RECORD,,