wizata-dsapi 2.2.0.dev9__tar.gz → 2.2.0.dev10__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.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/PKG-INFO +1 -1
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/__init__.py +1 -1
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/inventory.py +49 -0
- wizata_dsapi-2.2.0.dev10/wizata_dsapi/version.py +1 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/wizata_dsapi_client.py +18 -1
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi.egg-info/PKG-INFO +1 -1
- wizata_dsapi-2.2.0.dev9/wizata_dsapi/version.py +0 -1
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/LICENSE.txt +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/README.rst +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/setup.cfg +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/setup.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/api_config.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/api_dto.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/api_interface.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/bucket.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/business_label.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/connection.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/connection_types.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/context.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/dashboard.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/dataframe_toolkit.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/datapoint.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/datastore.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/deployment.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/ds_dataframe.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/dsapi_json_encoder.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/edge_config.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/edge_device.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/edge_module.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/evaluation.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/execution.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/execution_log.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/experiment.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/graylog_log.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/group_system.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/ilogger.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/insight.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/mlmodel.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/mobile_asset.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/model_toolkit.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/models/__init__.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/models/common.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/notification.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/paged_query_result.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/pipeline.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/pipeline_image.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/plot.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/plots/__init__.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/plots/common.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/plots/theme.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/product.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/request.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/script.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/scripts/__init__.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/scripts/common.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/search.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/solution_component.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/streamlit_utils.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/template.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/template_config.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/trigger.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/twin.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/twinregistration.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/user.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/wizard_function.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/wizard_request.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi/words.py +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi.egg-info/SOURCES.txt +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi.egg-info/dependency_links.txt +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi.egg-info/requires.txt +0 -0
- {wizata_dsapi-2.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi.egg-info/top_level.txt +0 -0
|
@@ -66,7 +66,7 @@ from .connection import Connection, ConnectionMapping, ConnectionDirection, Tran
|
|
|
66
66
|
from .connection_types import ConnectionType, CONNECTION_TYPES, TRANSFORM_SCHEMAS, get_connection_type, \
|
|
67
67
|
list_connection_types
|
|
68
68
|
from .product import ProductKind, Product, ProductComponent, BUILTIN_PRODUCT_KINDS, is_valid_product_key
|
|
69
|
-
from .inventory import (InventoryBalance, inventory_mode, INVENTORY_OPTION, INVENTORY_MODES,
|
|
69
|
+
from .inventory import (InventoryBalance, InventoryStorage, InventoryStorageDatapoint, inventory_mode, INVENTORY_OPTION, INVENTORY_MODES,
|
|
70
70
|
INVENTORY_MOVEMENTS, INVENTORY_BALANCES, INVENTORY_STOCK,
|
|
71
71
|
PRODUCT_TAG, PRODUCT_MESSAGE_KEY)
|
|
72
72
|
from .dashboard import Dashboard, DashboardType
|
|
@@ -155,3 +155,52 @@ class InventoryBalance:
|
|
|
155
155
|
def __repr__(self) -> str:
|
|
156
156
|
return (f"InventoryBalance(datapoint={self.datapoint!r}, product={self.product!r}, "
|
|
157
157
|
f"timestamp={self.timestamp!r}, quantity={self.quantity!r})")
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
class InventoryStorageDatapoint:
|
|
161
|
+
"""One inventoryMovement DataPoint of a storage: its category and unit (DEV-6086)."""
|
|
162
|
+
|
|
163
|
+
def __init__(self, hardware_id: str = None, name: str = None, category=None, unit=None,
|
|
164
|
+
unit_symbol: str = None):
|
|
165
|
+
self.hardware_id: Optional[str] = hardware_id
|
|
166
|
+
self.name: Optional[str] = name
|
|
167
|
+
self.category: Optional[str] = _uuid_str(category)
|
|
168
|
+
self.unit: Optional[str] = _uuid_str(unit)
|
|
169
|
+
self.unit_symbol: Optional[str] = unit_symbol
|
|
170
|
+
|
|
171
|
+
def to_dict(self) -> dict:
|
|
172
|
+
return {"hardwareId": self.hardware_id, "name": self.name, "category": self.category,
|
|
173
|
+
"unit": self.unit, "unitSymbol": self.unit_symbol}
|
|
174
|
+
|
|
175
|
+
@classmethod
|
|
176
|
+
def from_dict(cls, data: dict) -> "InventoryStorageDatapoint":
|
|
177
|
+
return cls(hardware_id=data.get("hardwareId") or data.get("hardware_id"), name=data.get("name"),
|
|
178
|
+
category=data.get("category"), unit=data.get("unit"),
|
|
179
|
+
unit_symbol=data.get("unitSymbol") or data.get("unit_symbol"))
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class InventoryStorage:
|
|
183
|
+
"""
|
|
184
|
+
A storage place: a Twin holding at least one inventoryMovement DataPoint (DEV-6086).
|
|
185
|
+
Read only, from ``POST /dsapi/planner/inventory/storages/search``.
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
def __init__(self, twin_id=None, twin_hardware_id: str = None, twin_name: str = None,
|
|
189
|
+
datapoints: list = None):
|
|
190
|
+
self.twin_id: Optional[str] = _uuid_str(twin_id)
|
|
191
|
+
self.twin_hardware_id: Optional[str] = twin_hardware_id
|
|
192
|
+
self.twin_name: Optional[str] = twin_name
|
|
193
|
+
self.datapoints: list = list(datapoints or [])
|
|
194
|
+
|
|
195
|
+
def to_dict(self) -> dict:
|
|
196
|
+
return {"twin": {"id": self.twin_id, "hardwareId": self.twin_hardware_id, "name": self.twin_name},
|
|
197
|
+
"datapoints": [d.to_dict() for d in self.datapoints]}
|
|
198
|
+
|
|
199
|
+
@classmethod
|
|
200
|
+
def from_dict(cls, data: dict) -> "InventoryStorage":
|
|
201
|
+
twin = data.get("twin") or {}
|
|
202
|
+
return cls(twin_id=twin.get("id"), twin_hardware_id=twin.get("hardwareId"), twin_name=twin.get("name"),
|
|
203
|
+
datapoints=[InventoryStorageDatapoint.from_dict(d) for d in data.get("datapoints") or []])
|
|
204
|
+
|
|
205
|
+
def __repr__(self) -> str:
|
|
206
|
+
return f"InventoryStorage({self.twin_hardware_id!r}, {[d.hardware_id for d in self.datapoints]})"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.2.0.dev10"
|
|
@@ -55,7 +55,7 @@ from .version import __version__
|
|
|
55
55
|
import ast
|
|
56
56
|
from .deployment import Deployment, DeploymentStatus
|
|
57
57
|
from .product import ProductKind, Product, ProductComponent
|
|
58
|
-
from .inventory import InventoryBalance
|
|
58
|
+
from .inventory import InventoryBalance, InventoryStorage
|
|
59
59
|
from .api_config import _registry
|
|
60
60
|
|
|
61
61
|
from .streamlit_utils import get_streamlit_token, get_streamlit_domain
|
|
@@ -2909,6 +2909,23 @@ class WizataDSAPIClient(ApiInterface, ApiDtoInterface):
|
|
|
2909
2909
|
body=search_query.to_dict())
|
|
2910
2910
|
return PagedQueryResult.from_dict(response.json(), dto_class=InventoryBalance)
|
|
2911
2911
|
|
|
2912
|
+
def search_inventory_storages(self, search_query=None) -> PagedQueryResult:
|
|
2913
|
+
"""
|
|
2914
|
+
The storage places: Twins holding an inventoryMovement DataPoint, each with those
|
|
2915
|
+
datapoints' category, unit and unit symbol (DEV-6086).
|
|
2916
|
+
|
|
2917
|
+
:param search_query: SearchQuery or dict; filters ``twin`` (hardware id or id) and
|
|
2918
|
+
``category`` (eq / in), ``_search`` (``{"query": text}`` on names and hardware ids).
|
|
2919
|
+
:return: PagedQueryResult with InventoryStorage results, sorted by twin name.
|
|
2920
|
+
"""
|
|
2921
|
+
if search_query is None:
|
|
2922
|
+
search_query = SearchQuery()
|
|
2923
|
+
elif isinstance(search_query, dict):
|
|
2924
|
+
search_query = SearchQuery.from_dict(search_query)
|
|
2925
|
+
response = self._planner_request("POST", "planner/inventory/storages/search",
|
|
2926
|
+
body=search_query.to_dict())
|
|
2927
|
+
return PagedQueryResult.from_dict(response.json(), dto_class=InventoryStorage)
|
|
2928
|
+
|
|
2912
2929
|
@staticmethod
|
|
2913
2930
|
def _balance_id(value) -> str:
|
|
2914
2931
|
balance_id = value.id if isinstance(value, InventoryBalance) else value
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.2.0.dev9"
|
|
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
|
|
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.2.0.dev9 → wizata_dsapi-2.2.0.dev10}/wizata_dsapi.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|