wizata-dsapi 2.0.0.dev2__tar.gz → 2.0.0.dev3__tar.gz
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-2.0.0.dev2/wizata_dsapi.egg-info → wizata_dsapi-2.0.0.dev3}/PKG-INFO +1 -1
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/__init__.py +2 -1
- wizata_dsapi-2.0.0.dev3/wizata_dsapi/dashboard.py +112 -0
- wizata_dsapi-2.0.0.dev3/wizata_dsapi/version.py +1 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3/wizata_dsapi.egg-info}/PKG-INFO +1 -1
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi.egg-info/SOURCES.txt +1 -0
- wizata_dsapi-2.0.0.dev2/wizata_dsapi/version.py +0 -1
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/LICENSE.txt +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/README.rst +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/setup.cfg +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/setup.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/api_config.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/api_dto.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/api_interface.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/bucket.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/business_label.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/context.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/dataframe_toolkit.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/datapoint.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/datastore.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/ds_dataframe.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/dsapi_json_encoder.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/edge_device.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/evaluation.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/execution.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/execution_log.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/experiment.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/group_system.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/ilogger.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/insight.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/mlmodel.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/model_toolkit.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/models/__init__.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/models/common.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/notification.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/paged_query_result.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/pipeline.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/pipeline_image.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/plot.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/plots/__init__.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/plots/common.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/request.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/script.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/scripts/__init__.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/scripts/common.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/search.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/solution_component.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/streamlit_utils.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/template.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/trigger.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/twin.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/twinregistration.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/wizard_function.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/wizard_request.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/wizata_dsapi_client.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi/words.py +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi.egg-info/dependency_links.txt +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi.egg-info/requires.txt +0 -0
- {wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi.egg-info/top_level.txt +0 -0
|
@@ -51,4 +51,5 @@ from .streamlit_utils import (get_streamlit_token, get_streamlit_domain, get_str
|
|
|
51
51
|
|
|
52
52
|
from .search import FilterOperator, SearchQuery, SortOption, GroupSearchQuery
|
|
53
53
|
from .notification import NotificationScope, DeviceToken, AlertRule, AlertActive
|
|
54
|
-
from .edge_device import EdgeDevice, EdgeDeviceStatus, EdgeDeviceType
|
|
54
|
+
from .edge_device import EdgeDevice, EdgeDeviceStatus, EdgeDeviceType
|
|
55
|
+
from .dashboard import Dashboard, DashboardType
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Dashboard DTO for mobile dashboard persistence.
|
|
3
|
+
|
|
4
|
+
DashboardType — platform the dashboard is designed for:
|
|
5
|
+
- MOBILE: mobile app dashboard.
|
|
6
|
+
|
|
7
|
+
Dashboard — stores a named dashboard with an ordered list of tiles.
|
|
8
|
+
Linked to either a template (by key) or a twin (by hardware_id), not both.
|
|
9
|
+
Tiles are stored as a JSON array — tile order is array index.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from datetime import datetime, timezone
|
|
13
|
+
from enum import Enum
|
|
14
|
+
from typing import Optional
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class DashboardType(str, Enum):
|
|
18
|
+
MOBILE = "mobile"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Dashboard:
|
|
22
|
+
"""
|
|
23
|
+
Dashboard entity stored in PostgreSQL ``"Dashboard"`` table.
|
|
24
|
+
|
|
25
|
+
PK is ``id`` (UUID, server-generated).
|
|
26
|
+
|
|
27
|
+
- ``name``: display name.
|
|
28
|
+
- ``dashboard_type``: MOBILE (more values later).
|
|
29
|
+
- ``template``: template key (mutually exclusive with ``twin``).
|
|
30
|
+
- ``twin``: twin hardware ID (mutually exclusive with ``template``).
|
|
31
|
+
- ``tiles``: ordered list of tile dicts (type + config).
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
def __init__(self):
|
|
35
|
+
self.id: Optional[str] = None
|
|
36
|
+
self.name: Optional[str] = None
|
|
37
|
+
self.dashboard_type: Optional[DashboardType] = None
|
|
38
|
+
self.template: Optional[str] = None
|
|
39
|
+
self.twin: Optional[str] = None
|
|
40
|
+
self.tiles: list = []
|
|
41
|
+
self.created_at: Optional[datetime] = None
|
|
42
|
+
self.updated_at: Optional[datetime] = None
|
|
43
|
+
|
|
44
|
+
# ------------------------------------------------------------------
|
|
45
|
+
# Serialisation
|
|
46
|
+
# ------------------------------------------------------------------
|
|
47
|
+
|
|
48
|
+
def to_dict(self) -> dict:
|
|
49
|
+
obj = {}
|
|
50
|
+
if self.id is not None:
|
|
51
|
+
obj["id"] = str(self.id)
|
|
52
|
+
if self.name is not None:
|
|
53
|
+
obj["name"] = self.name
|
|
54
|
+
if self.dashboard_type is not None:
|
|
55
|
+
obj["dashboardType"] = (
|
|
56
|
+
self.dashboard_type.value
|
|
57
|
+
if isinstance(self.dashboard_type, DashboardType)
|
|
58
|
+
else self.dashboard_type
|
|
59
|
+
)
|
|
60
|
+
if self.template is not None:
|
|
61
|
+
obj["template"] = self.template
|
|
62
|
+
if self.twin is not None:
|
|
63
|
+
obj["twin"] = self.twin
|
|
64
|
+
obj["tiles"] = list(self.tiles)
|
|
65
|
+
if self.created_at is not None:
|
|
66
|
+
obj["createdAt"] = int(self.created_at.timestamp() * 1000)
|
|
67
|
+
if self.updated_at is not None:
|
|
68
|
+
obj["updatedAt"] = int(self.updated_at.timestamp() * 1000)
|
|
69
|
+
return obj
|
|
70
|
+
|
|
71
|
+
@classmethod
|
|
72
|
+
def from_dict(cls, data: dict) -> "Dashboard":
|
|
73
|
+
obj = cls()
|
|
74
|
+
obj.id = data.get("id")
|
|
75
|
+
obj.name = data.get("name")
|
|
76
|
+
|
|
77
|
+
raw_type = data.get("dashboardType") or data.get("dashboard_type")
|
|
78
|
+
if raw_type is not None:
|
|
79
|
+
obj.dashboard_type = DashboardType(raw_type.lower())
|
|
80
|
+
|
|
81
|
+
obj.template = data.get("template")
|
|
82
|
+
obj.twin = data.get("twin")
|
|
83
|
+
obj.tiles = data.get("tiles") or []
|
|
84
|
+
|
|
85
|
+
created_raw = data.get("createdAt") or data.get("created_at")
|
|
86
|
+
if created_raw is not None:
|
|
87
|
+
obj.created_at = datetime.fromtimestamp(created_raw / 1000, tz=timezone.utc)
|
|
88
|
+
|
|
89
|
+
updated_raw = data.get("updatedAt") or data.get("updated_at")
|
|
90
|
+
if updated_raw is not None:
|
|
91
|
+
obj.updated_at = datetime.fromtimestamp(updated_raw / 1000, tz=timezone.utc)
|
|
92
|
+
return obj
|
|
93
|
+
|
|
94
|
+
# ------------------------------------------------------------------
|
|
95
|
+
# API identity helpers
|
|
96
|
+
# ------------------------------------------------------------------
|
|
97
|
+
|
|
98
|
+
def api_id(self) -> str:
|
|
99
|
+
return str(self.id) if self.id else None
|
|
100
|
+
|
|
101
|
+
def api_key(self) -> str:
|
|
102
|
+
return str(self.id) if self.id else None
|
|
103
|
+
|
|
104
|
+
def set_id(self, value):
|
|
105
|
+
self.id = str(value)
|
|
106
|
+
|
|
107
|
+
def __repr__(self) -> str:
|
|
108
|
+
return (
|
|
109
|
+
f"Dashboard(id={self.id!r}, name={self.name!r}, "
|
|
110
|
+
f"type={self.dashboard_type!r}, "
|
|
111
|
+
f"template={self.template!r}, twin={self.twin!r})"
|
|
112
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.0.0.dev3"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.0.0.dev2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wizata_dsapi-2.0.0.dev2 → wizata_dsapi-2.0.0.dev3}/wizata_dsapi.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|