wizata-dsapi 1.2.5__py3-none-any.whl → 1.2.7__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.
- wizata_dsapi/__init__.py +1 -1
- wizata_dsapi/api_config.py +7 -1
- wizata_dsapi/request.py +20 -19
- wizata_dsapi/twin.py +94 -0
- wizata_dsapi/version.py +1 -1
- {wizata_dsapi-1.2.5.dist-info → wizata_dsapi-1.2.7.dist-info}/METADATA +1 -1
- {wizata_dsapi-1.2.5.dist-info → wizata_dsapi-1.2.7.dist-info}/RECORD +10 -10
- {wizata_dsapi-1.2.5.dist-info → wizata_dsapi-1.2.7.dist-info}/LICENSE.txt +0 -0
- {wizata_dsapi-1.2.5.dist-info → wizata_dsapi-1.2.7.dist-info}/WHEEL +0 -0
- {wizata_dsapi-1.2.5.dist-info → wizata_dsapi-1.2.7.dist-info}/top_level.txt +0 -0
wizata_dsapi/__init__.py
CHANGED
|
@@ -18,7 +18,7 @@ from .group_system import GroupSystem
|
|
|
18
18
|
from .bucket import Bucket
|
|
19
19
|
|
|
20
20
|
# Sql Entities (Dto)
|
|
21
|
-
from .twin import Twin, TwinBlockType
|
|
21
|
+
from .twin import Twin, TwinBlockType, TwinType
|
|
22
22
|
from .datapoint import DataPoint, BusinessType, Label, Unit, Category, InputModeType
|
|
23
23
|
from .datastore import DataStore
|
|
24
24
|
from .insight import Insight
|
wizata_dsapi/api_config.py
CHANGED
|
@@ -14,7 +14,7 @@ from .solution_component import SolutionComponent
|
|
|
14
14
|
from .business_label import BusinessLabel
|
|
15
15
|
from .twinregistration import TwinRegistration, TwinRegistrationProperty
|
|
16
16
|
from .trigger import Trigger
|
|
17
|
-
from .twin import Twin
|
|
17
|
+
from .twin import Twin, TwinType
|
|
18
18
|
from .pipeline import Pipeline
|
|
19
19
|
from .pipeline_image import PipelineImage
|
|
20
20
|
from .insight import Insight
|
|
@@ -147,5 +147,11 @@ _registry = {
|
|
|
147
147
|
"class": Twin,
|
|
148
148
|
"cloud_dsapi": ['lists', 'get_by_id', 'get_by_key', 'create', 'update', 'delete', 'search'],
|
|
149
149
|
"cloud_context": ['get_by_id', 'get_by_key', 'create', 'update', 'delete', 'search']
|
|
150
|
+
},
|
|
151
|
+
"twintypes":
|
|
152
|
+
{
|
|
153
|
+
"class": TwinType,
|
|
154
|
+
"cloud_dsapi": [ 'get_by_id', 'create', 'update', 'delete'],
|
|
155
|
+
"cloud_context": [ 'get_by_id', 'create', 'update', 'delete' ]
|
|
150
156
|
}
|
|
151
157
|
}
|
wizata_dsapi/request.py
CHANGED
|
@@ -15,25 +15,6 @@ filter_map = {
|
|
|
15
15
|
'!=': 'neq'
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
class RequestGroupMap:
|
|
20
|
-
"""
|
|
21
|
-
Define a mapping between a set of datapoints and their corresponding event datapoint.
|
|
22
|
-
:ivar event_hardware_id str: hardware id of the datapoint identifying event inside a group.
|
|
23
|
-
:ivar event_datapoint: datapoint complete definition corresponding to event_hardware_id.
|
|
24
|
-
:ivar datapoints_hardware_ids list: list of all related datapoints.
|
|
25
|
-
:ivar datapoints dict: dict with key as hardware id and value datapoint for all mapped datapoints.
|
|
26
|
-
"""
|
|
27
|
-
|
|
28
|
-
def __init__(self,
|
|
29
|
-
event_hardware_id: str,
|
|
30
|
-
datapoints_hardware_ids: list):
|
|
31
|
-
self.event_hardware_id = event_hardware_id
|
|
32
|
-
self.datapoints_hardware_ids = datapoints_hardware_ids
|
|
33
|
-
self.event_datapoint = None
|
|
34
|
-
self.datapoints = {}
|
|
35
|
-
|
|
36
|
-
|
|
37
18
|
class RequestGroup:
|
|
38
19
|
"""
|
|
39
20
|
Define a group statement within a structured query.
|
|
@@ -87,6 +68,26 @@ class RequestGroup:
|
|
|
87
68
|
return group
|
|
88
69
|
|
|
89
70
|
|
|
71
|
+
class RequestGroupMap:
|
|
72
|
+
"""
|
|
73
|
+
Define a mapping between a set of datapoints and their corresponding event datapoint.
|
|
74
|
+
:ivar event_hardware_id str: hardware id of the datapoint identifying event inside a group.
|
|
75
|
+
:ivar event_datapoint: datapoint complete definition corresponding to event_hardware_id.
|
|
76
|
+
:ivar datapoints_hardware_ids list: list of all related datapoints.
|
|
77
|
+
:ivar datapoints dict: dict with key as hardware id and value datapoint for all mapped datapoints.
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
def __init__(self,
|
|
81
|
+
event_hardware_id: str,
|
|
82
|
+
datapoints_hardware_ids: list,
|
|
83
|
+
group: RequestGroup = None):
|
|
84
|
+
self.event_hardware_id = event_hardware_id
|
|
85
|
+
self.datapoints_hardware_ids = datapoints_hardware_ids
|
|
86
|
+
self.event_datapoint = None
|
|
87
|
+
self.datapoints = {}
|
|
88
|
+
self.group = group
|
|
89
|
+
|
|
90
|
+
|
|
90
91
|
class Request(ApiDto):
|
|
91
92
|
"""
|
|
92
93
|
request defines how to fetch data from time-series database.
|
wizata_dsapi/twin.py
CHANGED
|
@@ -13,8 +13,96 @@ def is_valid_hex_color(color):
|
|
|
13
13
|
return True
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
class TwinType(ApiDto):
|
|
17
|
+
"""
|
|
18
|
+
twin type
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
@classmethod
|
|
22
|
+
def route(cls):
|
|
23
|
+
return "twintypes"
|
|
24
|
+
|
|
25
|
+
@classmethod
|
|
26
|
+
def from_dict(cls, data):
|
|
27
|
+
obj = TwinType()
|
|
28
|
+
obj.from_json(data)
|
|
29
|
+
return obj
|
|
30
|
+
|
|
31
|
+
def __init__(self,
|
|
32
|
+
twin_type_id: uuid.UUID = None,
|
|
33
|
+
name: str = None,
|
|
34
|
+
icon: str = None,
|
|
35
|
+
color: str = None,
|
|
36
|
+
description: str = None):
|
|
37
|
+
if twin_type_id is None:
|
|
38
|
+
self.twin_type_id = uuid.uuid4()
|
|
39
|
+
else:
|
|
40
|
+
self.twin_type_id = twin_type_id
|
|
41
|
+
self.name = name
|
|
42
|
+
self.icon = icon
|
|
43
|
+
self.color = color
|
|
44
|
+
if color is not None:
|
|
45
|
+
is_valid_hex_color(color)
|
|
46
|
+
self.description = description
|
|
47
|
+
self.createdById = None
|
|
48
|
+
self.createdDate = None
|
|
49
|
+
self.updatedById = None
|
|
50
|
+
self.updatedDate = None
|
|
51
|
+
|
|
52
|
+
def api_id(self) -> str:
|
|
53
|
+
return str(self.twin_type_id).upper()
|
|
54
|
+
|
|
55
|
+
def endpoint(self) -> str:
|
|
56
|
+
return "TwinTypes"
|
|
57
|
+
|
|
58
|
+
def from_json(self, obj):
|
|
59
|
+
if "id" in obj.keys():
|
|
60
|
+
self.twin_type_id = uuid.UUID(obj["id"])
|
|
61
|
+
if "name" in obj.keys() and obj["name"] is not None:
|
|
62
|
+
self.name = obj["name"]
|
|
63
|
+
if "color" in obj.keys() and obj["color"] is not None:
|
|
64
|
+
is_valid_hex_color(str(obj["color"]))
|
|
65
|
+
self.color = str(obj["color"])
|
|
66
|
+
if "icon" in obj.keys() and obj["icon"] is not None:
|
|
67
|
+
self.icon = str(obj["icon"])
|
|
68
|
+
if "description" in obj.keys() and obj["description"] is not None:
|
|
69
|
+
self.description = str(obj["description"])
|
|
70
|
+
if "createdById" in obj.keys() and obj["createdById"] is not None:
|
|
71
|
+
self.createdById = obj["createdById"]
|
|
72
|
+
if "createdDate" in obj.keys() and obj["createdDate"] is not None:
|
|
73
|
+
self.createdDate = obj["createdDate"]
|
|
74
|
+
if "updatedById" in obj.keys() and obj["updatedById"] is not None:
|
|
75
|
+
self.updatedById = obj["updatedById"]
|
|
76
|
+
if "updatedDate" in obj.keys() and obj["updatedDate"] is not None:
|
|
77
|
+
self.updatedDate = obj["updatedDate"]
|
|
78
|
+
|
|
79
|
+
def to_json(self, target: str = None):
|
|
80
|
+
obj = {
|
|
81
|
+
"id": str(self.twin_type_id)
|
|
82
|
+
}
|
|
83
|
+
if self.name is not None:
|
|
84
|
+
obj["name"] = str(self.name)
|
|
85
|
+
if self.color is not None:
|
|
86
|
+
obj["color"] = str(self.color)
|
|
87
|
+
if self.description is not None:
|
|
88
|
+
obj["description"] = str(self.description)
|
|
89
|
+
if self.icon is not None:
|
|
90
|
+
obj["icon"] = str(self.icon)
|
|
91
|
+
if self.createdById is not None:
|
|
92
|
+
obj["createdById"] = str(self.createdById)
|
|
93
|
+
if self.createdDate is not None:
|
|
94
|
+
obj["createdDate"] = str(self.createdDate)
|
|
95
|
+
if self.updatedById is not None:
|
|
96
|
+
obj["updatedById"] = str(self.updatedById)
|
|
97
|
+
if self.updatedDate is not None:
|
|
98
|
+
obj["updatedDate"] = str(self.updatedDate)
|
|
99
|
+
return obj
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
16
103
|
class TwinBlockType(Enum):
|
|
17
104
|
"""
|
|
105
|
+
deprecated - replaced by TwinType
|
|
18
106
|
digital twin block type
|
|
19
107
|
- area
|
|
20
108
|
- machine
|
|
@@ -59,6 +147,7 @@ class Twin(ApiDto):
|
|
|
59
147
|
return obj
|
|
60
148
|
|
|
61
149
|
def __init__(self, twin_id=None, hardware_id=None, name=None, parent_id=None, ttype=TwinBlockType.MACHINE,
|
|
150
|
+
type_id:uuid.UUID = None,
|
|
62
151
|
latitude_id: uuid.UUID = None, longitude_id: uuid.UUID = None, color: str = None, icon: str = None,
|
|
63
152
|
latitude: float = None, longitude: float = None, description: str = None):
|
|
64
153
|
if twin_id is None:
|
|
@@ -69,6 +158,7 @@ class Twin(ApiDto):
|
|
|
69
158
|
self.name = name
|
|
70
159
|
self.parent_id = parent_id
|
|
71
160
|
self.type = ttype
|
|
161
|
+
self.type_id = type_id
|
|
72
162
|
self.description = description
|
|
73
163
|
self.latitude = latitude
|
|
74
164
|
self.longitude = longitude
|
|
@@ -98,6 +188,8 @@ class Twin(ApiDto):
|
|
|
98
188
|
self.name = obj["name"]
|
|
99
189
|
if "parentId" in obj.keys() and obj["parentId"] is not None:
|
|
100
190
|
self.parent_id = uuid.UUID(obj["parentId"])
|
|
191
|
+
if "twinTypeId" in obj.keys() and obj["twinTypeId"] is not None:
|
|
192
|
+
self.type_id = uuid.UUID(obj["twinTypeId"])
|
|
101
193
|
if "latitude" in obj.keys() and obj["latitude"] is not None:
|
|
102
194
|
self.latitude = float(obj["latitude"])
|
|
103
195
|
if "longitude" in obj.keys() and obj["longitude"] is not None:
|
|
@@ -134,6 +226,8 @@ class Twin(ApiDto):
|
|
|
134
226
|
obj["name"] = str(self.name)
|
|
135
227
|
if self.parent_id is not None:
|
|
136
228
|
obj["parentId"] = str(self.parent_id)
|
|
229
|
+
if self.type_id is not None:
|
|
230
|
+
obj["twinTypeId"] = str(self.type_id)
|
|
137
231
|
if self.type is not None and isinstance(self.type, TwinBlockType):
|
|
138
232
|
obj["type"] = self.type.value
|
|
139
233
|
if self.color is not None:
|
wizata_dsapi/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.2.
|
|
1
|
+
__version__ = "1.2.7"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
wizata_dsapi/__init__.py,sha256=
|
|
2
|
-
wizata_dsapi/api_config.py,sha256=
|
|
1
|
+
wizata_dsapi/__init__.py,sha256=4J-4ssj9oyI_5vv2_vMOR5ZFYQxrcHrmv900KOQEFYY,2010
|
|
2
|
+
wizata_dsapi/api_config.py,sha256=pyGPyoCrfOFl-C6DlDRdQbQWDG2Y_oB4gvzjh2wYb8w,5300
|
|
3
3
|
wizata_dsapi/api_dto.py,sha256=-NdaTRvw5jW5xFGpIhY8U0-SdvzW2t6QD26y0UPApU0,2238
|
|
4
4
|
wizata_dsapi/api_interface.py,sha256=DURk-0ey16T8sV5e2Y2G_YybPEusJvZuY0oD5L7AnXo,10903
|
|
5
5
|
wizata_dsapi/bucket.py,sha256=Zz9olv-pymikAutGitSuGWrAPiawOTW86JDDHG4ugTc,1150
|
|
@@ -23,15 +23,15 @@ wizata_dsapi/pipeline.py,sha256=WDJeOxPZJiYW1qwTNZUm3jom2epIxqrSoiUwcrTF9EE,3130
|
|
|
23
23
|
wizata_dsapi/pipeline_deployment.py,sha256=grekBaxUK0EhL9w7lDB8vNuW_wzLnHVm9Mq8Lkbkguk,1722
|
|
24
24
|
wizata_dsapi/pipeline_image.py,sha256=M3FOr45dJIAEvsmXPpMD8JZ09k5-YpW9PRYEWJqptcI,5272
|
|
25
25
|
wizata_dsapi/plot.py,sha256=SPGKFWWYNcRvHcqvvnPIIIBKsd5UwhdsxLW7b2dG2rs,2360
|
|
26
|
-
wizata_dsapi/request.py,sha256=
|
|
26
|
+
wizata_dsapi/request.py,sha256=WTwctIzHLLtSSixcXBsNyoyLqdZk8dZdaCTVbejSvIQ,26287
|
|
27
27
|
wizata_dsapi/script.py,sha256=DeEciwVpuCYZetgJCoivw_bYe8ma52WuTaTQ_VkLEcg,12930
|
|
28
28
|
wizata_dsapi/solution_component.py,sha256=8gbZWx2h_xUqI_pAXa3goqAnR5Y-GDMii8MeGlaK1IE,9531
|
|
29
29
|
wizata_dsapi/streamlit_utils.py,sha256=sXBdygktbixV828Zg01Nl27_a4F8zGFc4RY0C8g-1bc,1942
|
|
30
30
|
wizata_dsapi/template.py,sha256=h2f3dLduJ4WhreVxJXuFIB3pinnI3c39WxBms0bCgos,13007
|
|
31
31
|
wizata_dsapi/trigger.py,sha256=w3BZYP-L3SUwvaT0oCTanh_Ewn57peZvlt7vxzHv9J8,5129
|
|
32
|
-
wizata_dsapi/twin.py,sha256=
|
|
32
|
+
wizata_dsapi/twin.py,sha256=LXlX4kUl7JzONyXsuyHfcEFcXvo5ne0PGJfHfK4bXEc,9895
|
|
33
33
|
wizata_dsapi/twinregistration.py,sha256=Mi6-YuwroiEXc0c1hgrOaphh4hNVoHupxOnXedVtJtE,13377
|
|
34
|
-
wizata_dsapi/version.py,sha256=
|
|
34
|
+
wizata_dsapi/version.py,sha256=49prCLbE3fFzLfxem5rd2dr1iV4_L-bN0N4J7jxU5yA,22
|
|
35
35
|
wizata_dsapi/wizard_function.py,sha256=RbM7W7Gf-6Rhp_1dU9DBYkHaciknGAGvuAndhAS_vyo,942
|
|
36
36
|
wizata_dsapi/wizard_request.py,sha256=v6BaqKLKvTWmUSo0_gda9FabAQz5x_-GOH1Av50GzFo,3762
|
|
37
37
|
wizata_dsapi/wizata_dsapi_client.py,sha256=Qz54vYoxRLBUa21Q55K5Oo1qtZpW9ucuXi4BX1N85oE,78716
|
|
@@ -42,8 +42,8 @@ wizata_dsapi/plots/__init__.py,sha256=qgnSFqrjOPur-807M8uh5awIfjM1ZHXUXcAqHc-r2l
|
|
|
42
42
|
wizata_dsapi/plots/common.py,sha256=jdPsJqLHBwSKc6dX83BSGPqSRxzIVNHSYO5yI_8sjGk,6568
|
|
43
43
|
wizata_dsapi/scripts/__init__.py,sha256=hAxiETSQf0qOHde1si1tEAJU48seqEgHrchCzS2-LvQ,80
|
|
44
44
|
wizata_dsapi/scripts/common.py,sha256=efwq-Rd0lvYljIs3gSFz9izogBD7asOU2cTK-IvHTkM,4244
|
|
45
|
-
wizata_dsapi-1.2.
|
|
46
|
-
wizata_dsapi-1.2.
|
|
47
|
-
wizata_dsapi-1.2.
|
|
48
|
-
wizata_dsapi-1.2.
|
|
49
|
-
wizata_dsapi-1.2.
|
|
45
|
+
wizata_dsapi-1.2.7.dist-info/LICENSE.txt,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
46
|
+
wizata_dsapi-1.2.7.dist-info/METADATA,sha256=mLlTT4h_hWFEe07idxFfTx1-guTPcgIu56sAfrIoUEA,2187
|
|
47
|
+
wizata_dsapi-1.2.7.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
48
|
+
wizata_dsapi-1.2.7.dist-info/top_level.txt,sha256=-OeTJbEnh5DuWyTOHtvw0Dw3LRg3G27TNS6W4ZtfwPs,13
|
|
49
|
+
wizata_dsapi-1.2.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|