UncountablePythonSDK 0.0.48__py3-none-any.whl → 0.0.49__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.
Potentially problematic release.
This version of UncountablePythonSDK might be problematic. Click here for more details.
- {UncountablePythonSDK-0.0.48.dist-info → UncountablePythonSDK-0.0.49.dist-info}/METADATA +1 -1
- {UncountablePythonSDK-0.0.48.dist-info → UncountablePythonSDK-0.0.49.dist-info}/RECORD +8 -8
- pkgs/filesystem_utils/__init__.py +2 -0
- uncountable/integration/executors/generic_upload_executor.py +40 -0
- uncountable/types/job_definition.py +2 -0
- uncountable/types/job_definition_t.py +26 -1
- {UncountablePythonSDK-0.0.48.dist-info → UncountablePythonSDK-0.0.49.dist-info}/WHEEL +0 -0
- {UncountablePythonSDK-0.0.48.dist-info → UncountablePythonSDK-0.0.49.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: UncountablePythonSDK
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.49
|
|
4
4
|
Summary: Uncountable SDK
|
|
5
5
|
Project-URL: Homepage, https://github.com/uncountableinc/uncountable-python-sdk
|
|
6
6
|
Project-URL: Repository, https://github.com/uncountableinc/uncountable-python-sdk.git
|
|
@@ -25,7 +25,7 @@ pkgs/argument_parser/_is_enum.py,sha256=Gw6jJa8nBwYGqXwwCZbSnWL8Rvr5alkg5lSVAqXt
|
|
|
25
25
|
pkgs/argument_parser/_is_namedtuple.py,sha256=Rjc1bKanIPPogl3qG5JPBxglG1TqWYOo1nxxhBASQWY,265
|
|
26
26
|
pkgs/argument_parser/argument_parser.py,sha256=S5x4yDpaBqTRkmcOyX2UuBWw9iCE4j2Po5LZPg9jhe4,17308
|
|
27
27
|
pkgs/argument_parser/case_convert.py,sha256=NuJLJUJRbyVb6_Slen4uqaStEHbcOS1d-hBBfDrrw-c,605
|
|
28
|
-
pkgs/filesystem_utils/__init__.py,sha256=
|
|
28
|
+
pkgs/filesystem_utils/__init__.py,sha256=NSsQrUCoGISBCqCCyq6_583sYHTVEQeDjDO8hvZn3ag,1261
|
|
29
29
|
pkgs/filesystem_utils/_gdrive_session.py,sha256=OZudNoP2HikolnpurVJhJdh5fgzqbaZQvn53ReGGXx4,11015
|
|
30
30
|
pkgs/filesystem_utils/_local_session.py,sha256=xFEYhAvNqrOYqwt4jrEYOuYkjJn0zclZhTelW_Q1-rw,2325
|
|
31
31
|
pkgs/filesystem_utils/_s3_session.py,sha256=q4q0MTWXWu5RNRVZ5ibv4M4UXXxWl_J6xCnitvngIMM,3957
|
|
@@ -87,7 +87,7 @@ uncountable/integration/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
|
87
87
|
uncountable/integration/db/connect.py,sha256=YtQHJ1DBGPhxKFRCfiXqohOYUceKSxMVOJ88aPI48Ug,181
|
|
88
88
|
uncountable/integration/executors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
89
89
|
uncountable/integration/executors/executors.py,sha256=v5ClGVUlvrZcMdmGQa8Ll668G_HGTnKpGOnTM7UMZCQ,956
|
|
90
|
-
uncountable/integration/executors/generic_upload_executor.py,sha256=
|
|
90
|
+
uncountable/integration/executors/generic_upload_executor.py,sha256=HR5bZE1DMVLRB-lwmsfZnoLEsaL66aHZM0xCEO_D3-4,10238
|
|
91
91
|
uncountable/integration/executors/script_executor.py,sha256=OmSBOtU48G3mqza9c2lCm84pGGyaDk-ZBJCx3RsdJXc,846
|
|
92
92
|
uncountable/integration/secret_retrieval/__init__.py,sha256=3QXVj35w8rRMxVvmmsViFYDi3lcb3g70incfalOEm6o,87
|
|
93
93
|
uncountable/integration/secret_retrieval/retrieve_secret.py,sha256=M0qXVJpD8hMYIFypHFeyh598sqmIDX8ZOyXK23CluF0,1323
|
|
@@ -124,8 +124,8 @@ uncountable/types/input_attributes.py,sha256=IrIKQnHqHdS1Utdfzr9GnOe17a8riaqYcO1
|
|
|
124
124
|
uncountable/types/input_attributes_t.py,sha256=wE1ekiQfb72Z9VpF5SHipKJkgaJFUHJrNkkJdmuhF9w,820
|
|
125
125
|
uncountable/types/inputs.py,sha256=6RIEFfCxLqpeHEGOpu63O4i8zPogjGeB7wiV_rPBw_g,404
|
|
126
126
|
uncountable/types/inputs_t.py,sha256=RW7gF9zTOwByu-nMTMVuBabLOuWKx4O1nvfgvx_R55o,1611
|
|
127
|
-
uncountable/types/job_definition.py,sha256=
|
|
128
|
-
uncountable/types/job_definition_t.py,sha256=
|
|
127
|
+
uncountable/types/job_definition.py,sha256=sCQqtyHI3hksc5pVpk5tqbG55F91ST4FoDwr2TmTOuQ,1787
|
|
128
|
+
uncountable/types/job_definition_t.py,sha256=DpqTYDocJ6n6kVq5PBFhFb5Dlb2vpHdp9IZfFb1Qcpo,6590
|
|
129
129
|
uncountable/types/outputs.py,sha256=sUZx_X-TKCZtLm1YCEH8OISX9DdPlv9ZuUfM3-askCc,281
|
|
130
130
|
uncountable/types/outputs_t.py,sha256=2aORUOr0ls1ZYo-ddkWax3D1ZndmQsWtHfJxpYozlhg,656
|
|
131
131
|
uncountable/types/permissions.py,sha256=1mRnSsmRgjuLgp6pylTwwACD_YRIcmlqxHkufwZtMns,297
|
|
@@ -238,7 +238,7 @@ uncountable/types/api/triggers/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr
|
|
|
238
238
|
uncountable/types/api/triggers/run_trigger.py,sha256=_Rpha9nxXI3Xr17CrGDtofg4HZ81x2lt0rMZ6As0qfE,893
|
|
239
239
|
uncountable/types/api/uploader/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
240
240
|
uncountable/types/api/uploader/invoke_uploader.py,sha256=w7NVSpTpKxsF2TgLzVrji1Ql5Z8QWTz6d5OvXpRtyDo,992
|
|
241
|
-
UncountablePythonSDK-0.0.
|
|
242
|
-
UncountablePythonSDK-0.0.
|
|
243
|
-
UncountablePythonSDK-0.0.
|
|
244
|
-
UncountablePythonSDK-0.0.
|
|
241
|
+
UncountablePythonSDK-0.0.49.dist-info/METADATA,sha256=YzHISP7OjFmFRJWuVPWl6jgdlvsE6W7glCma0mhU7sc,1734
|
|
242
|
+
UncountablePythonSDK-0.0.49.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
|
|
243
|
+
UncountablePythonSDK-0.0.49.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
|
|
244
|
+
UncountablePythonSDK-0.0.49.dist-info/RECORD,,
|
|
@@ -5,12 +5,14 @@ from ._gdrive_session import list_gdrive_files as list_gdrive_files
|
|
|
5
5
|
from ._gdrive_session import move_gdrive_file as move_gdrive_file
|
|
6
6
|
from ._gdrive_session import upload_file_gdrive as upload_file_gdrive
|
|
7
7
|
from ._local_session import LocalSession as LocalSession
|
|
8
|
+
from ._s3_session import S3Session as S3Session
|
|
8
9
|
from ._sftp_session import SFTPSession as SFTPSession
|
|
9
10
|
from ._sftp_session import list_sftp_files as list_sftp_files
|
|
10
11
|
from ._sftp_session import move_sftp_files as move_sftp_files
|
|
11
12
|
from .file_type_utils import FileObjectData as FileObjectData
|
|
12
13
|
from .file_type_utils import FileSystemFileReference as FileSystemFileReference
|
|
13
14
|
from .file_type_utils import FileSystemObject as FileSystemObject
|
|
15
|
+
from .file_type_utils import FileSystemS3Config as FileSystemS3Config
|
|
14
16
|
from .file_type_utils import FileSystemSFTPConfig as FileSystemSFTPConfig
|
|
15
17
|
from .file_type_utils import FileTransfer as FileTransfer
|
|
16
18
|
from .file_type_utils import IncompatibleFileReference as IncompatibleFileReference
|
|
@@ -9,8 +9,10 @@ from pkgs.filesystem_utils import (
|
|
|
9
9
|
FileObjectData,
|
|
10
10
|
FileSystemFileReference,
|
|
11
11
|
FileSystemObject,
|
|
12
|
+
FileSystemS3Config,
|
|
12
13
|
FileSystemSFTPConfig,
|
|
13
14
|
FileTransfer,
|
|
15
|
+
S3Session,
|
|
14
16
|
SFTPSession,
|
|
15
17
|
)
|
|
16
18
|
from pkgs.filesystem_utils.filesystem_session import FileSystemSession
|
|
@@ -23,8 +25,10 @@ from uncountable.types.generic_upload_t import (
|
|
|
23
25
|
)
|
|
24
26
|
from uncountable.types.job_definition_t import (
|
|
25
27
|
GenericUploadDataSource,
|
|
28
|
+
GenericUploadDataSourceS3,
|
|
26
29
|
GenericUploadDataSourceSFTP,
|
|
27
30
|
JobResult,
|
|
31
|
+
S3CloudProvider,
|
|
28
32
|
)
|
|
29
33
|
|
|
30
34
|
|
|
@@ -185,6 +189,42 @@ class GenericUploadJob(Job):
|
|
|
185
189
|
pem_key=pem_key,
|
|
186
190
|
)
|
|
187
191
|
return SFTPSession(sftp_config=sftp_config)
|
|
192
|
+
case GenericUploadDataSourceS3():
|
|
193
|
+
if self.data_source.access_key_secret is not None:
|
|
194
|
+
secret_access_key = retrieve_secret(
|
|
195
|
+
self.data_source.access_key_secret,
|
|
196
|
+
profile_metadata=args.profile_metadata,
|
|
197
|
+
)
|
|
198
|
+
else:
|
|
199
|
+
secret_access_key = None
|
|
200
|
+
|
|
201
|
+
if self.data_source.endpoint_url is None:
|
|
202
|
+
assert (
|
|
203
|
+
self.data_source.cloud_provider is not None
|
|
204
|
+
), "either cloud_provider or endpoint_url must be specified"
|
|
205
|
+
match self.data_source.cloud_provider:
|
|
206
|
+
case S3CloudProvider.AWS:
|
|
207
|
+
endpoint_url = "https://s3.amazonaws.com"
|
|
208
|
+
case S3CloudProvider.OVH:
|
|
209
|
+
assert (
|
|
210
|
+
self.data_source.region_name is not None
|
|
211
|
+
), "region_name must be specified for cloud_provider OVH"
|
|
212
|
+
endpoint_url = (
|
|
213
|
+
f"https://s3.{self.data_source.region_name}.cloud.ovh.net"
|
|
214
|
+
)
|
|
215
|
+
else:
|
|
216
|
+
endpoint_url = self.data_source.endpoint_url
|
|
217
|
+
|
|
218
|
+
s3_config = FileSystemS3Config(
|
|
219
|
+
endpoint_url=endpoint_url,
|
|
220
|
+
bucket_name=self.data_source.bucket_name,
|
|
221
|
+
region_name=self.data_source.region_name,
|
|
222
|
+
access_key_id=self.data_source.access_key_id,
|
|
223
|
+
secret_access_key=secret_access_key,
|
|
224
|
+
session_token=None,
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
return S3Session(s3_config=s3_config)
|
|
188
228
|
|
|
189
229
|
def run(self, args: JobArguments) -> JobResult:
|
|
190
230
|
client = args.client
|
|
@@ -12,6 +12,8 @@ from .job_definition_t import JobExecutorBase as JobExecutorBase
|
|
|
12
12
|
from .job_definition_t import JobExecutorScript as JobExecutorScript
|
|
13
13
|
from .job_definition_t import GenericUploadDataSourceBase as GenericUploadDataSourceBase
|
|
14
14
|
from .job_definition_t import GenericUploadDataSourceSFTP as GenericUploadDataSourceSFTP
|
|
15
|
+
from .job_definition_t import S3CloudProvider as S3CloudProvider
|
|
16
|
+
from .job_definition_t import GenericUploadDataSourceS3 as GenericUploadDataSourceS3
|
|
15
17
|
from .job_definition_t import GenericUploadDataSource as GenericUploadDataSource
|
|
16
18
|
from .job_definition_t import JobExecutorGenericUpload as JobExecutorGenericUpload
|
|
17
19
|
from .job_definition_t import JobExecutor as JobExecutor
|
|
@@ -23,6 +23,7 @@ __all__: list[str] = [
|
|
|
23
23
|
"CronJobDefinition",
|
|
24
24
|
"GenericUploadDataSource",
|
|
25
25
|
"GenericUploadDataSourceBase",
|
|
26
|
+
"GenericUploadDataSourceS3",
|
|
26
27
|
"GenericUploadDataSourceSFTP",
|
|
27
28
|
"GenericUploadDataSourceType",
|
|
28
29
|
"JobDefinition",
|
|
@@ -36,6 +37,7 @@ __all__: list[str] = [
|
|
|
36
37
|
"JobResult",
|
|
37
38
|
"ProfileDefinition",
|
|
38
39
|
"ProfileMetadata",
|
|
40
|
+
"S3CloudProvider",
|
|
39
41
|
]
|
|
40
42
|
|
|
41
43
|
|
|
@@ -58,6 +60,7 @@ class AuthRetrievalType(StrEnum):
|
|
|
58
60
|
# DO NOT MODIFY -- This file is generated by type_spec
|
|
59
61
|
class GenericUploadDataSourceType(StrEnum):
|
|
60
62
|
SFTP = "sftp"
|
|
63
|
+
S3 = "s3"
|
|
61
64
|
|
|
62
65
|
|
|
63
66
|
# DO NOT MODIFY -- This file is generated by type_spec
|
|
@@ -94,13 +97,35 @@ class GenericUploadDataSourceSFTP(GenericUploadDataSourceBase):
|
|
|
94
97
|
pem_secret: secret_retrieval_t.SecretRetrieval
|
|
95
98
|
|
|
96
99
|
|
|
100
|
+
# DO NOT MODIFY -- This file is generated by type_spec
|
|
101
|
+
class S3CloudProvider(StrEnum):
|
|
102
|
+
OVH = "ovh"
|
|
103
|
+
AWS = "aws"
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
# DO NOT MODIFY -- This file is generated by type_spec
|
|
107
|
+
@serial_class(
|
|
108
|
+
parse_require={"type"},
|
|
109
|
+
)
|
|
110
|
+
@dataclasses.dataclass(kw_only=True)
|
|
111
|
+
class GenericUploadDataSourceS3(GenericUploadDataSourceBase):
|
|
112
|
+
type: typing.Literal[GenericUploadDataSourceType.S3] = GenericUploadDataSourceType.S3
|
|
113
|
+
bucket_name: str
|
|
114
|
+
cloud_provider: typing.Optional[S3CloudProvider] = None
|
|
115
|
+
endpoint_url: typing.Optional[str] = None
|
|
116
|
+
region_name: typing.Optional[str] = None
|
|
117
|
+
access_key_id: typing.Optional[str] = None
|
|
118
|
+
access_key_secret: typing.Optional[secret_retrieval_t.SecretRetrieval] = None
|
|
119
|
+
|
|
120
|
+
|
|
97
121
|
# DO NOT MODIFY -- This file is generated by type_spec
|
|
98
122
|
GenericUploadDataSource = typing.Annotated[
|
|
99
|
-
typing.Union[GenericUploadDataSourceSFTP],
|
|
123
|
+
typing.Union[GenericUploadDataSourceSFTP, GenericUploadDataSourceS3],
|
|
100
124
|
serial_union_annotation(
|
|
101
125
|
discriminator="type",
|
|
102
126
|
discriminator_map={
|
|
103
127
|
"sftp": GenericUploadDataSourceSFTP,
|
|
128
|
+
"s3": GenericUploadDataSourceS3,
|
|
104
129
|
},
|
|
105
130
|
),
|
|
106
131
|
]
|
|
File without changes
|
{UncountablePythonSDK-0.0.48.dist-info → UncountablePythonSDK-0.0.49.dist-info}/top_level.txt
RENAMED
|
File without changes
|