digitalhub 0.8.0__py3-none-any.whl → 0.8.0b0__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 digitalhub might be problematic. Click here for more details.
- digitalhub/__init__.py +94 -63
- {digitalhub-0.8.0.dist-info → digitalhub-0.8.0b0.dist-info}/METADATA +13 -29
- digitalhub-0.8.0b0.dist-info/RECORD +14 -0
- {digitalhub-0.8.0.dist-info → digitalhub-0.8.0b0.dist-info}/WHEEL +1 -1
- test/test_crud_artifacts.py +96 -0
- test/test_crud_dataitems.py +96 -0
- test/test_crud_functions.py +1 -1
- test/test_crud_runs.py +1 -1
- test/test_crud_tasks.py +1 -1
- digitalhub/client/__init__.py +0 -0
- digitalhub/client/_base/__init__.py +0 -0
- digitalhub/client/_base/client.py +0 -56
- digitalhub/client/api.py +0 -63
- digitalhub/client/builder.py +0 -50
- digitalhub/client/dhcore/__init__.py +0 -0
- digitalhub/client/dhcore/client.py +0 -669
- digitalhub/client/dhcore/env.py +0 -21
- digitalhub/client/dhcore/models.py +0 -46
- digitalhub/client/dhcore/utils.py +0 -111
- digitalhub/client/local/__init__.py +0 -0
- digitalhub/client/local/client.py +0 -533
- digitalhub/context/__init__.py +0 -0
- digitalhub/context/api.py +0 -93
- digitalhub/context/builder.py +0 -94
- digitalhub/context/context.py +0 -136
- digitalhub/datastores/__init__.py +0 -0
- digitalhub/datastores/_base/__init__.py +0 -0
- digitalhub/datastores/_base/datastore.py +0 -85
- digitalhub/datastores/api.py +0 -37
- digitalhub/datastores/builder.py +0 -110
- digitalhub/datastores/local/__init__.py +0 -0
- digitalhub/datastores/local/datastore.py +0 -50
- digitalhub/datastores/remote/__init__.py +0 -0
- digitalhub/datastores/remote/datastore.py +0 -31
- digitalhub/datastores/s3/__init__.py +0 -0
- digitalhub/datastores/s3/datastore.py +0 -46
- digitalhub/datastores/sql/__init__.py +0 -0
- digitalhub/datastores/sql/datastore.py +0 -68
- digitalhub/entities/__init__.py +0 -0
- digitalhub/entities/_base/__init__.py +0 -0
- digitalhub/entities/_base/_base/__init__.py +0 -0
- digitalhub/entities/_base/_base/entity.py +0 -82
- digitalhub/entities/_base/api_utils.py +0 -620
- digitalhub/entities/_base/context/__init__.py +0 -0
- digitalhub/entities/_base/context/entity.py +0 -118
- digitalhub/entities/_base/crud.py +0 -468
- digitalhub/entities/_base/entity/__init__.py +0 -0
- digitalhub/entities/_base/entity/_constructors/__init__.py +0 -0
- digitalhub/entities/_base/entity/_constructors/metadata.py +0 -44
- digitalhub/entities/_base/entity/_constructors/name.py +0 -31
- digitalhub/entities/_base/entity/_constructors/spec.py +0 -33
- digitalhub/entities/_base/entity/_constructors/status.py +0 -52
- digitalhub/entities/_base/entity/_constructors/uuid.py +0 -26
- digitalhub/entities/_base/entity/builder.py +0 -175
- digitalhub/entities/_base/entity/entity.py +0 -106
- digitalhub/entities/_base/entity/metadata.py +0 -59
- digitalhub/entities/_base/entity/spec.py +0 -58
- digitalhub/entities/_base/entity/status.py +0 -43
- digitalhub/entities/_base/executable/__init__.py +0 -0
- digitalhub/entities/_base/executable/entity.py +0 -405
- digitalhub/entities/_base/material/__init__.py +0 -0
- digitalhub/entities/_base/material/entity.py +0 -214
- digitalhub/entities/_base/material/spec.py +0 -22
- digitalhub/entities/_base/material/status.py +0 -49
- digitalhub/entities/_base/runtime_entity/__init__.py +0 -0
- digitalhub/entities/_base/runtime_entity/builder.py +0 -106
- digitalhub/entities/_base/unversioned/__init__.py +0 -0
- digitalhub/entities/_base/unversioned/builder.py +0 -66
- digitalhub/entities/_base/unversioned/entity.py +0 -49
- digitalhub/entities/_base/versioned/__init__.py +0 -0
- digitalhub/entities/_base/versioned/builder.py +0 -68
- digitalhub/entities/_base/versioned/entity.py +0 -53
- digitalhub/entities/artifact/__init__.py +0 -0
- digitalhub/entities/artifact/_base/__init__.py +0 -0
- digitalhub/entities/artifact/_base/builder.py +0 -86
- digitalhub/entities/artifact/_base/entity.py +0 -39
- digitalhub/entities/artifact/_base/spec.py +0 -15
- digitalhub/entities/artifact/_base/status.py +0 -9
- digitalhub/entities/artifact/artifact/__init__.py +0 -0
- digitalhub/entities/artifact/artifact/builder.py +0 -18
- digitalhub/entities/artifact/artifact/entity.py +0 -32
- digitalhub/entities/artifact/artifact/spec.py +0 -27
- digitalhub/entities/artifact/artifact/status.py +0 -15
- digitalhub/entities/artifact/crud.py +0 -332
- digitalhub/entities/builders.py +0 -63
- digitalhub/entities/dataitem/__init__.py +0 -0
- digitalhub/entities/dataitem/_base/__init__.py +0 -0
- digitalhub/entities/dataitem/_base/builder.py +0 -86
- digitalhub/entities/dataitem/_base/entity.py +0 -75
- digitalhub/entities/dataitem/_base/spec.py +0 -15
- digitalhub/entities/dataitem/_base/status.py +0 -20
- digitalhub/entities/dataitem/crud.py +0 -372
- digitalhub/entities/dataitem/dataitem/__init__.py +0 -0
- digitalhub/entities/dataitem/dataitem/builder.py +0 -18
- digitalhub/entities/dataitem/dataitem/entity.py +0 -32
- digitalhub/entities/dataitem/dataitem/spec.py +0 -15
- digitalhub/entities/dataitem/dataitem/status.py +0 -9
- digitalhub/entities/dataitem/iceberg/__init__.py +0 -0
- digitalhub/entities/dataitem/iceberg/builder.py +0 -18
- digitalhub/entities/dataitem/iceberg/entity.py +0 -32
- digitalhub/entities/dataitem/iceberg/spec.py +0 -15
- digitalhub/entities/dataitem/iceberg/status.py +0 -9
- digitalhub/entities/dataitem/table/__init__.py +0 -0
- digitalhub/entities/dataitem/table/builder.py +0 -18
- digitalhub/entities/dataitem/table/entity.py +0 -146
- digitalhub/entities/dataitem/table/models.py +0 -62
- digitalhub/entities/dataitem/table/spec.py +0 -25
- digitalhub/entities/dataitem/table/status.py +0 -9
- digitalhub/entities/function/__init__.py +0 -0
- digitalhub/entities/function/_base/__init__.py +0 -0
- digitalhub/entities/function/_base/builder.py +0 -79
- digitalhub/entities/function/_base/entity.py +0 -98
- digitalhub/entities/function/_base/models.py +0 -118
- digitalhub/entities/function/_base/spec.py +0 -15
- digitalhub/entities/function/_base/status.py +0 -9
- digitalhub/entities/function/crud.py +0 -279
- digitalhub/entities/model/__init__.py +0 -0
- digitalhub/entities/model/_base/__init__.py +0 -0
- digitalhub/entities/model/_base/builder.py +0 -86
- digitalhub/entities/model/_base/entity.py +0 -34
- digitalhub/entities/model/_base/spec.py +0 -49
- digitalhub/entities/model/_base/status.py +0 -9
- digitalhub/entities/model/crud.py +0 -331
- digitalhub/entities/model/huggingface/__init__.py +0 -0
- digitalhub/entities/model/huggingface/builder.py +0 -18
- digitalhub/entities/model/huggingface/entity.py +0 -32
- digitalhub/entities/model/huggingface/spec.py +0 -36
- digitalhub/entities/model/huggingface/status.py +0 -9
- digitalhub/entities/model/mlflow/__init__.py +0 -0
- digitalhub/entities/model/mlflow/builder.py +0 -18
- digitalhub/entities/model/mlflow/entity.py +0 -32
- digitalhub/entities/model/mlflow/models.py +0 -26
- digitalhub/entities/model/mlflow/spec.py +0 -44
- digitalhub/entities/model/mlflow/status.py +0 -9
- digitalhub/entities/model/mlflow/utils.py +0 -81
- digitalhub/entities/model/model/__init__.py +0 -0
- digitalhub/entities/model/model/builder.py +0 -18
- digitalhub/entities/model/model/entity.py +0 -32
- digitalhub/entities/model/model/spec.py +0 -15
- digitalhub/entities/model/model/status.py +0 -9
- digitalhub/entities/model/sklearn/__init__.py +0 -0
- digitalhub/entities/model/sklearn/builder.py +0 -18
- digitalhub/entities/model/sklearn/entity.py +0 -32
- digitalhub/entities/model/sklearn/spec.py +0 -15
- digitalhub/entities/model/sklearn/status.py +0 -9
- digitalhub/entities/project/__init__.py +0 -0
- digitalhub/entities/project/_base/__init__.py +0 -0
- digitalhub/entities/project/_base/builder.py +0 -128
- digitalhub/entities/project/_base/entity.py +0 -2078
- digitalhub/entities/project/_base/spec.py +0 -50
- digitalhub/entities/project/_base/status.py +0 -9
- digitalhub/entities/project/crud.py +0 -357
- digitalhub/entities/run/__init__.py +0 -0
- digitalhub/entities/run/_base/__init__.py +0 -0
- digitalhub/entities/run/_base/builder.py +0 -94
- digitalhub/entities/run/_base/entity.py +0 -307
- digitalhub/entities/run/_base/spec.py +0 -50
- digitalhub/entities/run/_base/status.py +0 -9
- digitalhub/entities/run/crud.py +0 -219
- digitalhub/entities/secret/__init__.py +0 -0
- digitalhub/entities/secret/_base/__init__.py +0 -0
- digitalhub/entities/secret/_base/builder.py +0 -81
- digitalhub/entities/secret/_base/entity.py +0 -74
- digitalhub/entities/secret/_base/spec.py +0 -35
- digitalhub/entities/secret/_base/status.py +0 -9
- digitalhub/entities/secret/crud.py +0 -290
- digitalhub/entities/task/__init__.py +0 -0
- digitalhub/entities/task/_base/__init__.py +0 -0
- digitalhub/entities/task/_base/builder.py +0 -91
- digitalhub/entities/task/_base/entity.py +0 -136
- digitalhub/entities/task/_base/models.py +0 -208
- digitalhub/entities/task/_base/spec.py +0 -53
- digitalhub/entities/task/_base/status.py +0 -9
- digitalhub/entities/task/crud.py +0 -228
- digitalhub/entities/utils/__init__.py +0 -0
- digitalhub/entities/utils/api.py +0 -346
- digitalhub/entities/utils/entity_types.py +0 -19
- digitalhub/entities/utils/state.py +0 -31
- digitalhub/entities/utils/utils.py +0 -202
- digitalhub/entities/workflow/__init__.py +0 -0
- digitalhub/entities/workflow/_base/__init__.py +0 -0
- digitalhub/entities/workflow/_base/builder.py +0 -79
- digitalhub/entities/workflow/_base/entity.py +0 -74
- digitalhub/entities/workflow/_base/spec.py +0 -15
- digitalhub/entities/workflow/_base/status.py +0 -9
- digitalhub/entities/workflow/crud.py +0 -278
- digitalhub/factory/__init__.py +0 -0
- digitalhub/factory/api.py +0 -277
- digitalhub/factory/factory.py +0 -268
- digitalhub/factory/utils.py +0 -90
- digitalhub/readers/__init__.py +0 -0
- digitalhub/readers/_base/__init__.py +0 -0
- digitalhub/readers/_base/builder.py +0 -26
- digitalhub/readers/_base/reader.py +0 -70
- digitalhub/readers/api.py +0 -80
- digitalhub/readers/factory.py +0 -133
- digitalhub/readers/pandas/__init__.py +0 -0
- digitalhub/readers/pandas/builder.py +0 -29
- digitalhub/readers/pandas/reader.py +0 -207
- digitalhub/runtimes/__init__.py +0 -0
- digitalhub/runtimes/_base.py +0 -102
- digitalhub/runtimes/builder.py +0 -32
- digitalhub/stores/__init__.py +0 -0
- digitalhub/stores/_base/__init__.py +0 -0
- digitalhub/stores/_base/store.py +0 -189
- digitalhub/stores/api.py +0 -54
- digitalhub/stores/builder.py +0 -211
- digitalhub/stores/local/__init__.py +0 -0
- digitalhub/stores/local/store.py +0 -230
- digitalhub/stores/remote/__init__.py +0 -0
- digitalhub/stores/remote/store.py +0 -143
- digitalhub/stores/s3/__init__.py +0 -0
- digitalhub/stores/s3/store.py +0 -563
- digitalhub/stores/sql/__init__.py +0 -0
- digitalhub/stores/sql/store.py +0 -328
- digitalhub/utils/__init__.py +0 -0
- digitalhub/utils/data_utils.py +0 -127
- digitalhub/utils/exceptions.py +0 -67
- digitalhub/utils/file_utils.py +0 -204
- digitalhub/utils/generic_utils.py +0 -183
- digitalhub/utils/git_utils.py +0 -148
- digitalhub/utils/io_utils.py +0 -116
- digitalhub/utils/logger.py +0 -17
- digitalhub/utils/s3_utils.py +0 -58
- digitalhub/utils/uri_utils.py +0 -56
- digitalhub-0.8.0.dist-info/RECORD +0 -231
- test/local/CRUD/test_artifacts.py +0 -96
- test/local/CRUD/test_dataitems.py +0 -96
- test/local/CRUD/test_models.py +0 -95
- {digitalhub-0.8.0.dist-info → digitalhub-0.8.0b0.dist-info}/LICENSE.txt +0 -0
- {digitalhub-0.8.0.dist-info → digitalhub-0.8.0b0.dist-info}/top_level.txt +0 -0
- /test/{local/imports/test_imports.py → test_imports.py} +0 -0
digitalhub/__init__.py
CHANGED
|
@@ -1,82 +1,113 @@
|
|
|
1
|
-
from
|
|
1
|
+
from digitalhub_core import (
|
|
2
2
|
delete_artifact,
|
|
3
|
+
delete_function,
|
|
4
|
+
delete_project,
|
|
5
|
+
delete_run,
|
|
6
|
+
delete_secret,
|
|
7
|
+
delete_task,
|
|
8
|
+
delete_workflow,
|
|
3
9
|
get_artifact,
|
|
4
10
|
get_artifact_versions,
|
|
5
|
-
import_artifact,
|
|
6
|
-
list_artifacts,
|
|
7
|
-
log_artifact,
|
|
8
|
-
new_artifact,
|
|
9
|
-
update_artifact,
|
|
10
|
-
)
|
|
11
|
-
from digitalhub.entities.dataitem.crud import (
|
|
12
|
-
delete_dataitem,
|
|
13
|
-
get_dataitem,
|
|
14
|
-
get_dataitem_versions,
|
|
15
|
-
import_dataitem,
|
|
16
|
-
list_dataitems,
|
|
17
|
-
log_dataitem,
|
|
18
|
-
new_dataitem,
|
|
19
|
-
update_dataitem,
|
|
20
|
-
)
|
|
21
|
-
from digitalhub.entities.function.crud import (
|
|
22
|
-
delete_function,
|
|
23
11
|
get_function,
|
|
24
12
|
get_function_versions,
|
|
25
|
-
|
|
26
|
-
list_functions,
|
|
27
|
-
new_function,
|
|
28
|
-
update_function,
|
|
29
|
-
)
|
|
30
|
-
from digitalhub.entities.model.crud import (
|
|
31
|
-
delete_model,
|
|
32
|
-
get_model,
|
|
33
|
-
get_model_versions,
|
|
34
|
-
import_model,
|
|
35
|
-
list_models,
|
|
36
|
-
log_model,
|
|
37
|
-
new_model,
|
|
38
|
-
update_model,
|
|
39
|
-
)
|
|
40
|
-
from digitalhub.entities.project.crud import (
|
|
41
|
-
delete_project,
|
|
42
|
-
get_or_create_project,
|
|
43
|
-
get_project,
|
|
44
|
-
import_project,
|
|
45
|
-
load_project,
|
|
46
|
-
new_project,
|
|
47
|
-
update_project,
|
|
48
|
-
)
|
|
49
|
-
from digitalhub.entities.run.crud import delete_run, get_run, import_run, list_runs, new_run, update_run
|
|
50
|
-
from digitalhub.entities.secret.crud import (
|
|
51
|
-
delete_secret,
|
|
13
|
+
get_run,
|
|
52
14
|
get_secret,
|
|
53
15
|
get_secret_versions,
|
|
54
|
-
|
|
55
|
-
list_secrets,
|
|
56
|
-
new_secret,
|
|
57
|
-
update_secret,
|
|
58
|
-
)
|
|
59
|
-
from digitalhub.entities.task.crud import delete_task, get_task, import_task, list_tasks, new_task, update_task
|
|
60
|
-
from digitalhub.entities.workflow.crud import (
|
|
61
|
-
delete_workflow,
|
|
16
|
+
get_task,
|
|
62
17
|
get_workflow,
|
|
63
18
|
get_workflow_versions,
|
|
19
|
+
import_artifact,
|
|
20
|
+
import_function,
|
|
21
|
+
import_run,
|
|
22
|
+
import_secret,
|
|
23
|
+
import_task,
|
|
64
24
|
import_workflow,
|
|
25
|
+
list_artifacts,
|
|
26
|
+
list_functions,
|
|
27
|
+
list_runs,
|
|
28
|
+
list_secrets,
|
|
29
|
+
list_tasks,
|
|
65
30
|
list_workflows,
|
|
31
|
+
log_artifact,
|
|
32
|
+
new_artifact,
|
|
33
|
+
new_function,
|
|
34
|
+
new_run,
|
|
35
|
+
new_secret,
|
|
36
|
+
new_task,
|
|
66
37
|
new_workflow,
|
|
38
|
+
refresh_token,
|
|
39
|
+
set_dhcore_env,
|
|
40
|
+
set_store,
|
|
41
|
+
update_artifact,
|
|
42
|
+
update_function,
|
|
43
|
+
update_project,
|
|
44
|
+
update_run,
|
|
45
|
+
update_secret,
|
|
46
|
+
update_task,
|
|
67
47
|
update_workflow,
|
|
68
48
|
)
|
|
49
|
+
from digitalhub_core.registry.utils import register_layer_entities, register_runtimes_entities
|
|
69
50
|
|
|
70
|
-
|
|
71
|
-
from digitalhub.entities.model.mlflow.utils import from_mlflow_run
|
|
72
|
-
except ImportError:
|
|
73
|
-
...
|
|
51
|
+
_PROJECT_IMPORTED = False
|
|
74
52
|
|
|
75
|
-
|
|
53
|
+
if not _PROJECT_IMPORTED:
|
|
54
|
+
try:
|
|
55
|
+
from digitalhub_data import (
|
|
56
|
+
delete_dataitem,
|
|
57
|
+
get_dataitem,
|
|
58
|
+
get_dataitem_versions,
|
|
59
|
+
import_dataitem,
|
|
60
|
+
list_dataitems,
|
|
61
|
+
log_dataitem,
|
|
62
|
+
new_dataitem,
|
|
63
|
+
update_dataitem,
|
|
64
|
+
)
|
|
65
|
+
from digitalhub_ml import (
|
|
66
|
+
delete_model,
|
|
67
|
+
get_model,
|
|
68
|
+
get_model_versions,
|
|
69
|
+
get_or_create_project,
|
|
70
|
+
get_project,
|
|
71
|
+
import_model,
|
|
72
|
+
import_project,
|
|
73
|
+
list_models,
|
|
74
|
+
load_project,
|
|
75
|
+
log_model,
|
|
76
|
+
new_model,
|
|
77
|
+
new_project,
|
|
78
|
+
update_model,
|
|
79
|
+
)
|
|
76
80
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
81
|
+
_PROJECT_IMPORTED = True
|
|
82
|
+
except ImportError:
|
|
83
|
+
...
|
|
84
|
+
|
|
85
|
+
if not _PROJECT_IMPORTED:
|
|
86
|
+
try:
|
|
87
|
+
from digitalhub_data import (
|
|
88
|
+
delete_dataitem,
|
|
89
|
+
get_dataitem,
|
|
90
|
+
get_dataitem_versions,
|
|
91
|
+
get_or_create_project,
|
|
92
|
+
get_project,
|
|
93
|
+
import_dataitem,
|
|
94
|
+
import_project,
|
|
95
|
+
list_dataitems,
|
|
96
|
+
load_project,
|
|
97
|
+
log_dataitem,
|
|
98
|
+
new_dataitem,
|
|
99
|
+
new_project,
|
|
100
|
+
update_dataitem,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
_PROJECT_IMPORTED = True
|
|
104
|
+
except ImportError:
|
|
105
|
+
...
|
|
80
106
|
|
|
81
|
-
|
|
107
|
+
if not _PROJECT_IMPORTED:
|
|
108
|
+
from digitalhub_core import get_or_create_project, get_project, import_project, load_project, new_project
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
# Register entities into registry
|
|
112
|
+
register_layer_entities()
|
|
82
113
|
register_runtimes_entities()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: digitalhub
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.0b0
|
|
4
4
|
Summary: Python SDK for Digitalhub
|
|
5
5
|
Author-email: Fondazione Bruno Kessler <dslab@fbk.eu>, Matteo Martini <mmartini@fbk.eu>
|
|
6
6
|
License: Apache License
|
|
@@ -229,38 +229,22 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
229
229
|
Requires-Python: >=3.9
|
|
230
230
|
Description-Content-Type: text/markdown
|
|
231
231
|
License-File: LICENSE.txt
|
|
232
|
-
Requires-Dist:
|
|
233
|
-
|
|
234
|
-
Requires-Dist:
|
|
235
|
-
Requires-Dist:
|
|
236
|
-
|
|
237
|
-
Requires-Dist:
|
|
238
|
-
Requires-Dist: PyYAML
|
|
239
|
-
Requires-Dist: python-dotenv
|
|
240
|
-
Requires-Dist: GitPython>=3
|
|
241
|
-
Requires-Dist: psycopg2-binary
|
|
242
|
-
Requires-Dist: python-slugify
|
|
243
|
-
Provides-Extra: dev
|
|
244
|
-
Requires-Dist: black; extra == "dev"
|
|
245
|
-
Requires-Dist: pytest; extra == "dev"
|
|
246
|
-
Requires-Dist: bumpver; extra == "dev"
|
|
247
|
-
Requires-Dist: ruff; extra == "dev"
|
|
248
|
-
Requires-Dist: moto; extra == "dev"
|
|
249
|
-
Provides-Extra: docs
|
|
250
|
-
Requires-Dist: Sphinx>=7; extra == "docs"
|
|
251
|
-
Requires-Dist: pydata-sphinx-theme>=0.15; extra == "docs"
|
|
252
|
-
Requires-Dist: numpydoc>=1.6; extra == "docs"
|
|
232
|
+
Requires-Dist: digitalhub-core<0.9,>=0.8.0b
|
|
233
|
+
Provides-Extra: all
|
|
234
|
+
Requires-Dist: digitalhub-data<0.9,>=0.8.0b; extra == "all"
|
|
235
|
+
Requires-Dist: digitalhub-ml<0.9,>=0.8.0b; extra == "all"
|
|
236
|
+
Provides-Extra: data
|
|
237
|
+
Requires-Dist: digitalhub-data<0.9,>=0.8.0b; extra == "data"
|
|
253
238
|
Provides-Extra: full
|
|
254
|
-
Requires-Dist:
|
|
255
|
-
Requires-Dist:
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
Requires-Dist: pandas<2.2,>=1.2; extra == "pandas"
|
|
239
|
+
Requires-Dist: digitalhub-core[full]<0.9,>=0.8.0b; extra == "full"
|
|
240
|
+
Requires-Dist: digitalhub-data[pandas]<0.9,>=0.8.0b; extra == "full"
|
|
241
|
+
Requires-Dist: digitalhub-ml[mlflow]<0.9,>=0.8.0b; extra == "full"
|
|
242
|
+
Provides-Extra: ml
|
|
243
|
+
Requires-Dist: digitalhub-ml<0.9,>=0.8.0b; extra == "ml"
|
|
260
244
|
|
|
261
245
|
# Digitalhub Library
|
|
262
246
|
|
|
263
247
|
The Digitalhub SDK library is used to manage entities and executions in Digitalhub from Python.
|
|
264
248
|
It comes with a suite of tools to help you manage your projects and executions. It exposes CRUD methods to create, read, update and delete entities, and objects methods to excute functions or workflows, collect or store execution results and data.
|
|
265
249
|
|
|
266
|
-
A more detailed description of the library can be found in the [official documentation](https://scc-digitalhub.github.io/
|
|
250
|
+
A more detailed description of the library can be found in the [official documentation](https://scc-digitalhub.github.io/docs/) of Digitalhub.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
digitalhub/__init__.py,sha256=vvMeyMD5146sLRNYs6EQuUiN5D4O8cO0XfS8r-W5OuM,2540
|
|
2
|
+
test/test_crud_artifacts.py,sha256=CgPUAYRWurWWH1eRwGJp_6iiulGLy4bOPccvC3XqSCc,2489
|
|
3
|
+
test/test_crud_dataitems.py,sha256=jj15NUUyAAfOCYZEfZOxEq9f5s2_T3dVdfJ7agL50tc,2489
|
|
4
|
+
test/test_crud_functions.py,sha256=zihCaqWUps-Cm14BkCr5qHoOubeZPOn7TyKi49DSkE4,2768
|
|
5
|
+
test/test_crud_runs.py,sha256=MIOgrgEa6gdwoS6rhdOkPderZcQrdZXMptCV0w3f6-k,2219
|
|
6
|
+
test/test_crud_tasks.py,sha256=LLFf6teU64YF8m-gS02tyEoi_eHZmHw6OmO4yhe3Wqo,2110
|
|
7
|
+
test/test_imports.py,sha256=W-YugO0rpJwvtWp57MXaXfEmE-f5iWuCiLY-n0ZU4z8,1271
|
|
8
|
+
test/testkfp.py,sha256=01UpLKkVbwAQu4S1BMiddnnq5x1DStMlJtCoHzi9zq8,1060
|
|
9
|
+
test/testkfp_pipeline.py,sha256=WceFrCp-avHI7PcwIvnv7Kgs2xK3oQqU6sjaonGamg8,622
|
|
10
|
+
digitalhub-0.8.0b0.dist-info/LICENSE.txt,sha256=_yVOtnbW7Ss28mp058UEEc1X4Rgj8-kQBP_kj8_Sc88,11585
|
|
11
|
+
digitalhub-0.8.0b0.dist-info/METADATA,sha256=eZulZbNOcPcv3r2TmQROJEw8W7hde6umDPuH_4m3Mp4,14957
|
|
12
|
+
digitalhub-0.8.0b0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
13
|
+
digitalhub-0.8.0b0.dist-info/top_level.txt,sha256=ae9pDfCF27ZoaVAxuBKONMP0lm5P-N_I-e-no1WlvD8,16
|
|
14
|
+
digitalhub-0.8.0b0.dist-info/RECORD,,
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import shutil
|
|
2
|
+
from copy import deepcopy
|
|
3
|
+
|
|
4
|
+
import dotenv
|
|
5
|
+
from digitalhub_core.entities.artifact.entity._base import Artifact
|
|
6
|
+
|
|
7
|
+
import digitalhub as dh
|
|
8
|
+
|
|
9
|
+
dotenv.load_dotenv()
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def main():
|
|
13
|
+
ctx = "./test-prg"
|
|
14
|
+
names = ["test1", "test2", "test3", "test4"]
|
|
15
|
+
uuids = [
|
|
16
|
+
"d150bcca-bb64-451d-8455-dff862254b95",
|
|
17
|
+
"31acdd2d-0c41-428c-b68b-1b133da9e97b",
|
|
18
|
+
"b4a3dfdc-b917-44c4-9a29-613dcf734244",
|
|
19
|
+
"2618d9c4-cd61-440f-aebb-7e5761709f3b",
|
|
20
|
+
]
|
|
21
|
+
paths = ["./data/test.csv", "s3://bucket/key.csv", "sql://database/schema/table", "https://url.com/file.csv"]
|
|
22
|
+
kind = ["artifact", "artifact", "artifact", "artifact"]
|
|
23
|
+
|
|
24
|
+
dicts = []
|
|
25
|
+
for i in range(len(names)):
|
|
26
|
+
dicts.append({"name": names[i], "uuid": uuids[i], "path": paths[i], "kind": kind[i]})
|
|
27
|
+
|
|
28
|
+
dh.delete_project("test")
|
|
29
|
+
|
|
30
|
+
p = dh.get_or_create_project("test", context=ctx)
|
|
31
|
+
|
|
32
|
+
# Create and delete artifacts
|
|
33
|
+
for i in dicts:
|
|
34
|
+
d = dh.new_artifact(p.name, **i)
|
|
35
|
+
dh.delete_artifact(d.key)
|
|
36
|
+
d = dh.new_artifact(p.name, **i)
|
|
37
|
+
dh.delete_artifact(d.name, project=p.name, entity_id=d.id)
|
|
38
|
+
d = p.new_artifact(**i)
|
|
39
|
+
p.delete_artifact(d.key)
|
|
40
|
+
|
|
41
|
+
print("Done 1")
|
|
42
|
+
|
|
43
|
+
# Create multiple artifacts
|
|
44
|
+
for i in dicts:
|
|
45
|
+
dh.new_artifact(p.name, **i)
|
|
46
|
+
|
|
47
|
+
c = deepcopy(i)
|
|
48
|
+
c.pop("uuid")
|
|
49
|
+
dh.new_artifact(p.name, **c)
|
|
50
|
+
dh.new_artifact(p.name, **c)
|
|
51
|
+
dh.new_artifact(p.name, **c)
|
|
52
|
+
dh.new_artifact(p.name, **c)
|
|
53
|
+
|
|
54
|
+
# List artifacts
|
|
55
|
+
l_obj = dh.list_artifacts(p.name)
|
|
56
|
+
assert isinstance(l_obj, list)
|
|
57
|
+
assert len(l_obj) == 4
|
|
58
|
+
for i in l_obj:
|
|
59
|
+
assert isinstance(i, Artifact)
|
|
60
|
+
|
|
61
|
+
for a in l_obj:
|
|
62
|
+
dh.delete_artifact(a.key)
|
|
63
|
+
|
|
64
|
+
print("Done 2")
|
|
65
|
+
|
|
66
|
+
# Get artifacts test
|
|
67
|
+
for i in dicts:
|
|
68
|
+
o1 = dh.new_artifact(p.name, **i)
|
|
69
|
+
assert isinstance(o1, Artifact)
|
|
70
|
+
|
|
71
|
+
# Get by name and id
|
|
72
|
+
o2 = dh.get_artifact(o1.name, project=p.name, entity_id=o1.id)
|
|
73
|
+
assert isinstance(o2, Artifact)
|
|
74
|
+
assert o1.id == o2.id
|
|
75
|
+
|
|
76
|
+
# Get by key
|
|
77
|
+
o3 = dh.get_artifact(o1.key)
|
|
78
|
+
assert isinstance(o3, Artifact)
|
|
79
|
+
assert o1.id == o3.id
|
|
80
|
+
|
|
81
|
+
print("Done 3")
|
|
82
|
+
|
|
83
|
+
# Delete artifacts, all versions
|
|
84
|
+
for n in names:
|
|
85
|
+
dh.delete_artifact(n, project=p.name, delete_all_versions=True)
|
|
86
|
+
l_obj = dh.list_artifacts(p.name)
|
|
87
|
+
assert not l_obj
|
|
88
|
+
|
|
89
|
+
dh.delete_project("test")
|
|
90
|
+
shutil.rmtree(ctx)
|
|
91
|
+
|
|
92
|
+
print("Done 4")
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
if __name__ == "__main__":
|
|
96
|
+
main()
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import shutil
|
|
2
|
+
from copy import deepcopy
|
|
3
|
+
|
|
4
|
+
import dotenv
|
|
5
|
+
from digitalhub_data.entities.dataitem.entity._base import Dataitem
|
|
6
|
+
|
|
7
|
+
import digitalhub as dh
|
|
8
|
+
|
|
9
|
+
dotenv.load_dotenv()
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def main():
|
|
13
|
+
ctx = "./test-prg"
|
|
14
|
+
names = ["test1", "test2", "test3", "test4"]
|
|
15
|
+
uuids = [
|
|
16
|
+
"d150bcca-bb64-451d-8455-dff862254b95",
|
|
17
|
+
"31acdd2d-0c41-428c-b68b-1b133da9e97b",
|
|
18
|
+
"b4a3dfdc-b917-44c4-9a29-613dcf734244",
|
|
19
|
+
"2618d9c4-cd61-440f-aebb-7e5761709f3b",
|
|
20
|
+
]
|
|
21
|
+
paths = ["./data/test.csv", "s3://bucket/key.csv", "sql://database/schema/table", "https://url.com/file.csv"]
|
|
22
|
+
kind = ["dataitem", "dataitem", "dataitem", "dataitem"]
|
|
23
|
+
|
|
24
|
+
dicts = []
|
|
25
|
+
for i in range(len(names)):
|
|
26
|
+
dicts.append({"name": names[i], "uuid": uuids[i], "path": paths[i], "kind": kind[i]})
|
|
27
|
+
|
|
28
|
+
dh.delete_project("test")
|
|
29
|
+
|
|
30
|
+
p = dh.get_or_create_project("test", context=ctx)
|
|
31
|
+
|
|
32
|
+
# Create and delete dataitems
|
|
33
|
+
for i in dicts:
|
|
34
|
+
d = dh.new_dataitem(p.name, **i)
|
|
35
|
+
dh.delete_dataitem(d.key)
|
|
36
|
+
d = dh.new_dataitem(p.name, **i)
|
|
37
|
+
dh.delete_dataitem(d.name, project=p.name, entity_id=d.id)
|
|
38
|
+
d = p.new_dataitem(**i)
|
|
39
|
+
p.delete_dataitem(d.key)
|
|
40
|
+
|
|
41
|
+
print("Done 1")
|
|
42
|
+
|
|
43
|
+
# Create multiple dataitems
|
|
44
|
+
for i in dicts:
|
|
45
|
+
dh.new_dataitem(p.name, **i)
|
|
46
|
+
|
|
47
|
+
c = deepcopy(i)
|
|
48
|
+
c.pop("uuid")
|
|
49
|
+
dh.new_dataitem(p.name, **c)
|
|
50
|
+
dh.new_dataitem(p.name, **c)
|
|
51
|
+
dh.new_dataitem(p.name, **c)
|
|
52
|
+
dh.new_dataitem(p.name, **c)
|
|
53
|
+
|
|
54
|
+
# List dataitems
|
|
55
|
+
l_obj = dh.list_dataitems(p.name)
|
|
56
|
+
assert isinstance(l_obj, list)
|
|
57
|
+
assert len(l_obj) == 4
|
|
58
|
+
for i in l_obj:
|
|
59
|
+
assert isinstance(i, Dataitem)
|
|
60
|
+
|
|
61
|
+
for a in l_obj:
|
|
62
|
+
dh.delete_dataitem(a.key)
|
|
63
|
+
|
|
64
|
+
print("Done 2")
|
|
65
|
+
|
|
66
|
+
# Get dataitems test
|
|
67
|
+
for i in dicts:
|
|
68
|
+
o1 = dh.new_dataitem(p.name, **i)
|
|
69
|
+
assert isinstance(o1, Dataitem)
|
|
70
|
+
|
|
71
|
+
# Get by name and id
|
|
72
|
+
o2 = dh.get_dataitem(o1.name, project=p.name, entity_id=o1.id)
|
|
73
|
+
assert isinstance(o2, Dataitem)
|
|
74
|
+
assert o1.id == o2.id
|
|
75
|
+
|
|
76
|
+
# Get by key
|
|
77
|
+
o3 = dh.get_dataitem(o1.key)
|
|
78
|
+
assert isinstance(o3, Dataitem)
|
|
79
|
+
assert o1.id == o3.id
|
|
80
|
+
|
|
81
|
+
print("Done 3")
|
|
82
|
+
|
|
83
|
+
# Delete dataitems, all versions
|
|
84
|
+
for n in names:
|
|
85
|
+
dh.delete_dataitem(n, project=p.name, delete_all_versions=True)
|
|
86
|
+
l_obj = dh.list_dataitems(p.name)
|
|
87
|
+
assert not l_obj
|
|
88
|
+
|
|
89
|
+
dh.delete_project("test")
|
|
90
|
+
shutil.rmtree(ctx)
|
|
91
|
+
|
|
92
|
+
print("Done 4")
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
if __name__ == "__main__":
|
|
96
|
+
main()
|
test/test_crud_functions.py
CHANGED
test/test_crud_runs.py
CHANGED
test/test_crud_tasks.py
CHANGED
digitalhub/client/__init__.py
DELETED
|
File without changes
|
|
File without changes
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from abc import abstractmethod
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class Client:
|
|
7
|
-
"""
|
|
8
|
-
Base Client class interface.
|
|
9
|
-
|
|
10
|
-
The client is an interface that handles the CRUD of an object during
|
|
11
|
-
a session. It manages the creation, reading, updating, deleting and
|
|
12
|
-
listing of objects and comes into two subclasses: Local and DHCore.
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
@abstractmethod
|
|
16
|
-
def create_object(self, api: str, obj: dict, **kwargs) -> dict:
|
|
17
|
-
"""
|
|
18
|
-
Create object method.
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
@abstractmethod
|
|
22
|
-
def read_object(self, api: str, **kwargs) -> dict:
|
|
23
|
-
"""
|
|
24
|
-
Read object method.
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
@abstractmethod
|
|
28
|
-
def update_object(self, api: str, obj: dict, **kwargs) -> dict:
|
|
29
|
-
"""
|
|
30
|
-
Update object method.
|
|
31
|
-
"""
|
|
32
|
-
|
|
33
|
-
@abstractmethod
|
|
34
|
-
def delete_object(self, api: str, **kwargs) -> dict:
|
|
35
|
-
"""
|
|
36
|
-
Delete object method.
|
|
37
|
-
"""
|
|
38
|
-
|
|
39
|
-
@abstractmethod
|
|
40
|
-
def list_objects(self, api: str, **kwargs) -> dict:
|
|
41
|
-
"""
|
|
42
|
-
List objects method.
|
|
43
|
-
"""
|
|
44
|
-
|
|
45
|
-
@abstractmethod
|
|
46
|
-
def list_first_object(self, api: str, **kwargs) -> dict:
|
|
47
|
-
"""
|
|
48
|
-
Read first object method.
|
|
49
|
-
"""
|
|
50
|
-
|
|
51
|
-
@staticmethod
|
|
52
|
-
@abstractmethod
|
|
53
|
-
def is_local() -> bool:
|
|
54
|
-
"""
|
|
55
|
-
Flag to check if client is local.
|
|
56
|
-
"""
|
digitalhub/client/api.py
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import typing
|
|
4
|
-
|
|
5
|
-
from digitalhub.client.builder import client_builder
|
|
6
|
-
|
|
7
|
-
if typing.TYPE_CHECKING:
|
|
8
|
-
from digitalhub.client._base.client import Client
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def check_client_exists(local: bool = False) -> bool:
|
|
12
|
-
"""
|
|
13
|
-
Check if client exists.
|
|
14
|
-
|
|
15
|
-
Parameters
|
|
16
|
-
----------
|
|
17
|
-
local : bool
|
|
18
|
-
Check client existence by local.
|
|
19
|
-
|
|
20
|
-
Returns
|
|
21
|
-
-------
|
|
22
|
-
bool
|
|
23
|
-
True if client exists, False otherwise.
|
|
24
|
-
"""
|
|
25
|
-
if local:
|
|
26
|
-
return client_builder._local is not None
|
|
27
|
-
return client_builder._dhcore is not None
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def build_client(local: bool = False, config: dict | None = None) -> None:
|
|
31
|
-
"""
|
|
32
|
-
Wrapper around ClientBuilder.build.
|
|
33
|
-
|
|
34
|
-
Parameters
|
|
35
|
-
----------
|
|
36
|
-
local : bool
|
|
37
|
-
Whether to create a local client or not.
|
|
38
|
-
config : dict
|
|
39
|
-
DHCore environment configuration.
|
|
40
|
-
|
|
41
|
-
Returns
|
|
42
|
-
-------
|
|
43
|
-
Client
|
|
44
|
-
The client instance.
|
|
45
|
-
"""
|
|
46
|
-
client_builder.build(local, config)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def get_client(local: bool = False) -> Client:
|
|
50
|
-
"""
|
|
51
|
-
Wrapper around ClientBuilder.build.
|
|
52
|
-
|
|
53
|
-
Parameters
|
|
54
|
-
----------
|
|
55
|
-
local : bool
|
|
56
|
-
Whether to create a local client or not.
|
|
57
|
-
|
|
58
|
-
Returns
|
|
59
|
-
-------
|
|
60
|
-
Client
|
|
61
|
-
The client instance.
|
|
62
|
-
"""
|
|
63
|
-
return client_builder.build(local)
|
digitalhub/client/builder.py
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import typing
|
|
4
|
-
|
|
5
|
-
from digitalhub.client.dhcore.client import ClientDHCore
|
|
6
|
-
from digitalhub.client.local.client import ClientLocal
|
|
7
|
-
|
|
8
|
-
if typing.TYPE_CHECKING:
|
|
9
|
-
from digitalhub.client._base.client import Client
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class ClientBuilder:
|
|
13
|
-
"""
|
|
14
|
-
Client builder class.
|
|
15
|
-
|
|
16
|
-
This class is used to create two possible client instances:
|
|
17
|
-
Local and DHCore.
|
|
18
|
-
It saves the client instances in the class attributes using
|
|
19
|
-
singleton pattern.
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
def __init__(self) -> None:
|
|
23
|
-
self._local = None
|
|
24
|
-
self._dhcore = None
|
|
25
|
-
|
|
26
|
-
def build(self, local: bool = False, config: dict | None = None) -> Client:
|
|
27
|
-
"""
|
|
28
|
-
Method to create a client instance.
|
|
29
|
-
|
|
30
|
-
Parameters
|
|
31
|
-
----------
|
|
32
|
-
local : bool
|
|
33
|
-
Whether to create a local client or not.
|
|
34
|
-
|
|
35
|
-
Returns
|
|
36
|
-
-------
|
|
37
|
-
Client
|
|
38
|
-
Returns the client instance.
|
|
39
|
-
"""
|
|
40
|
-
if local:
|
|
41
|
-
if self._local is None:
|
|
42
|
-
self._local = ClientLocal()
|
|
43
|
-
return self._local
|
|
44
|
-
|
|
45
|
-
if self._dhcore is None:
|
|
46
|
-
self._dhcore = ClientDHCore(config)
|
|
47
|
-
return self._dhcore
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
client_builder = ClientBuilder()
|
|
File without changes
|