automizor 0.4.5__py3-none-any.whl → 0.4.6__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.
- automizor/__init__.py +1 -1
- automizor/datastore/__init__.py +1 -9
- automizor/datastore/_datastore.py +1 -27
- {automizor-0.4.5.dist-info → automizor-0.4.6.dist-info}/METADATA +1 -1
- {automizor-0.4.5.dist-info → automizor-0.4.6.dist-info}/RECORD +8 -8
- {automizor-0.4.5.dist-info → automizor-0.4.6.dist-info}/LICENSE +0 -0
- {automizor-0.4.5.dist-info → automizor-0.4.6.dist-info}/WHEEL +0 -0
- {automizor-0.4.5.dist-info → automizor-0.4.6.dist-info}/top_level.txt +0 -0
automizor/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
version = "0.4.
|
1
|
+
version = "0.4.6"
|
automizor/datastore/__init__.py
CHANGED
@@ -23,11 +23,6 @@ class DataStoreProxy(types.ModuleType):
|
|
23
23
|
through attribute access and assignment, making it simple to work with different
|
24
24
|
data structures.
|
25
25
|
|
26
|
-
The `DataStoreProxy` dynamically determines the type of data store being accessed
|
27
|
-
and adapts its behavior accordingly. For JSON data stores, it directly retrieves
|
28
|
-
values. For KKV stores, it provides a wrapper function that facilitates more complex
|
29
|
-
data retrieval operations based on primary and secondary keys.
|
30
|
-
|
31
26
|
Example usage:
|
32
27
|
|
33
28
|
.. code-block:: python
|
@@ -51,7 +46,7 @@ class DataStoreProxy(types.ModuleType):
|
|
51
46
|
}
|
52
47
|
|
53
48
|
# Get values from json store
|
54
|
-
countries = datastore.countries
|
49
|
+
countries = datastore.countries()
|
55
50
|
|
56
51
|
# Initialize or update kkv store
|
57
52
|
datastore.movies = {
|
@@ -98,13 +93,10 @@ class DataStoreProxy(types.ModuleType):
|
|
98
93
|
|
99
94
|
def __getattr__(self, name):
|
100
95
|
datastore = _get_datastore()
|
101
|
-
datastore_type = datastore.type(name)
|
102
96
|
|
103
97
|
def wrapper(primary_key=None, secondary_key=None):
|
104
98
|
return datastore.get_values(name, primary_key, secondary_key)
|
105
99
|
|
106
|
-
if datastore_type == "JSONDataStore":
|
107
|
-
return datastore.get_values(name)
|
108
100
|
return wrapper
|
109
101
|
|
110
102
|
def __setattr__(self, name, values: JSON):
|
@@ -15,7 +15,7 @@ class DataStore:
|
|
15
15
|
data using a unified API.
|
16
16
|
|
17
17
|
The class initializes an HTTP session with the necessary headers for authentication, and
|
18
|
-
provides methods to
|
18
|
+
provides methods to retrieve values, and set values in the store.
|
19
19
|
|
20
20
|
Attributes:
|
21
21
|
url (str): The base URL for the API endpoint.
|
@@ -28,19 +28,6 @@ class DataStore:
|
|
28
28
|
self.session = requests.Session()
|
29
29
|
self.session.headers.update(get_headers(self.token))
|
30
30
|
|
31
|
-
def type(self, name: str) -> str:
|
32
|
-
"""
|
33
|
-
Gets the type of the specified data store.
|
34
|
-
|
35
|
-
Parameters:
|
36
|
-
name (str): The name of the data store.
|
37
|
-
|
38
|
-
Returns:
|
39
|
-
str: The type of the data store.
|
40
|
-
"""
|
41
|
-
|
42
|
-
return self._get_type(name)
|
43
|
-
|
44
31
|
def get_values(
|
45
32
|
self,
|
46
33
|
name: str,
|
@@ -72,19 +59,6 @@ class DataStore:
|
|
72
59
|
|
73
60
|
return self._set_values(name, values)
|
74
61
|
|
75
|
-
def _get_type(self, name: str) -> str:
|
76
|
-
url = f"https://{self.url}/api/v1/workflow/datastore/{name}/"
|
77
|
-
try:
|
78
|
-
response = self.session.get(url, timeout=10)
|
79
|
-
response.raise_for_status()
|
80
|
-
return response.json().get("datastore_type")
|
81
|
-
except requests.HTTPError as exc:
|
82
|
-
raise AutomizorError.from_response(
|
83
|
-
exc.response, "Failed to get datastore values"
|
84
|
-
) from exc
|
85
|
-
except Exception as exc:
|
86
|
-
raise AutomizorError("Failed to get datastore values") from exc
|
87
|
-
|
88
62
|
def _get_values(
|
89
63
|
self,
|
90
64
|
name: str,
|
@@ -1,7 +1,7 @@
|
|
1
|
-
automizor/__init__.py,sha256=
|
1
|
+
automizor/__init__.py,sha256=DWNNbWBv-hyqVy76bKbnHWaDUbqL0BOtdkPSV_88dx0,18
|
2
2
|
automizor/exceptions.py,sha256=P5imySIOtG3ZIk2kh41Yod4RnlgTj7Vf0P3M-RuxQJs,1382
|
3
|
-
automizor/datastore/__init__.py,sha256=
|
4
|
-
automizor/datastore/_datastore.py,sha256=
|
3
|
+
automizor/datastore/__init__.py,sha256=lOCAgf-976kgD1bo7rBi43Ahh9NK8TahOktTfHi0DBA,3016
|
4
|
+
automizor/datastore/_datastore.py,sha256=f2SAmsn5HWMYN_WGar6q0PioIfEJQdWbGC-REKFI5Cw,3371
|
5
5
|
automizor/job/__init__.py,sha256=DNRuT6cyPQBaPRG4vNalCmEvcJQl-73b5ZDFOfNOwIg,1019
|
6
6
|
automizor/job/_job.py,sha256=_-ehqPwJdY89mWm3_VAuh7KRJdv-8iUu6iMAzwGLHM0,5235
|
7
7
|
automizor/log/__init__.py,sha256=gEr2SuwN1FgX1NMnbphjg8_gfSic9L15H3WC868A-TQ,2104
|
@@ -12,8 +12,8 @@ automizor/utils/__init__.py,sha256=2trRoR5lljYKbYdxmioSlvzajjQM0Wnoq3bvF9lEZ6w,8
|
|
12
12
|
automizor/vault/__init__.py,sha256=UjRiW3J0R9ABXc1gXIPyS3cqNCwMWxx0l-C0PsIg7R0,1699
|
13
13
|
automizor/vault/_container.py,sha256=-2y7kASigoIVAebuQBk-0R_sI4gfmvjsMLuMg_tR1xA,1945
|
14
14
|
automizor/vault/_vault.py,sha256=uRsjOjzsstZpYwJoHNg_cpv803Dzo4T2oF6hwiG3Eww,4688
|
15
|
-
automizor-0.4.
|
16
|
-
automizor-0.4.
|
17
|
-
automizor-0.4.
|
18
|
-
automizor-0.4.
|
19
|
-
automizor-0.4.
|
15
|
+
automizor-0.4.6.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
16
|
+
automizor-0.4.6.dist-info/METADATA,sha256=7njCCq1Bqgh7kwvoBAr-cdwr-vdNUxjPPS-DfvAWKMs,668
|
17
|
+
automizor-0.4.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
18
|
+
automizor-0.4.6.dist-info/top_level.txt,sha256=gScDy4I3tP6BMYAsTAlBXrxVh3E00zV0UioxwXJOI3Y,10
|
19
|
+
automizor-0.4.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|