wizata-dsapi 1.1.47__py3-none-any.whl → 1.2.1__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 CHANGED
@@ -45,4 +45,5 @@ from .pipeline_image import PipelineImage
45
45
  from .evaluation import Evaluation
46
46
 
47
47
  # Streamlit utils
48
- from .streamlit_utils import get_streamlit_token, get_streamlit_domain
48
+ from .streamlit_utils import (get_streamlit_token, get_streamlit_domain, get_streamlit_from, get_streamlit_to,
49
+ get_streamlit_twin_id)
wizata_dsapi/datastore.py CHANGED
@@ -5,7 +5,7 @@ class DataStore(ApiDto):
5
5
 
6
6
  @classmethod
7
7
  def route(cls):
8
- return "datastore"
8
+ return "datastores"
9
9
 
10
10
  @classmethod
11
11
  def from_dict(cls, data):
@@ -1,4 +1,9 @@
1
1
  import sys
2
+ import uuid
3
+ from typing import Optional
4
+ from uuid import UUID
5
+
6
+ from .dataframe_toolkit import generate_epoch
2
7
 
3
8
 
4
9
  def get_streamlit_token():
@@ -7,6 +12,7 @@ def get_streamlit_token():
7
12
  if st.query_params is not None and "auth_token" in st.query_params:
8
13
  auth_token = st.query_params["auth_token"]
9
14
  return auth_token
15
+ return None
10
16
 
11
17
 
12
18
  def get_streamlit_domain():
@@ -15,3 +21,48 @@ def get_streamlit_domain():
15
21
  if st.query_params is not None and "dsapi" in st.query_params:
16
22
  domain = st.query_params["dsapi"]
17
23
  return domain
24
+ return None
25
+
26
+ def get_streamlit_twin_id() -> Optional[UUID]:
27
+ """
28
+ return current selected twin_id.
29
+ :return:
30
+ """
31
+ if 'streamlit' in sys.modules:
32
+ st = sys.modules['streamlit']
33
+ if st.query_params is not None and "twin_id" in st.query_params:
34
+ twin_id = uuid.UUID(st.query_params["twin_id"])
35
+ return twin_id
36
+ return None
37
+
38
+
39
+ def get_streamlit_from() -> Optional[int]:
40
+ """
41
+ timestamp representation of from parameter on UI (ms)
42
+ :return:
43
+ """
44
+ if 'streamlit' in sys.modules:
45
+ st = sys.modules['streamlit']
46
+ if st.query_params is not None and "from" in st.query_params:
47
+ param = st.query_params["from"]
48
+ if 'now' in param:
49
+ return generate_epoch(param)
50
+ else:
51
+ return int(param)
52
+ return None
53
+
54
+
55
+ def get_streamlit_to() -> Optional[int]:
56
+ """
57
+ timestamp representation of to parameter on UI (ms)
58
+ :return:
59
+ """
60
+ if 'streamlit' in sys.modules:
61
+ st = sys.modules['streamlit']
62
+ if st.query_params is not None and "to" in st.query_params:
63
+ param = st.query_params["to"]
64
+ if 'now' in param:
65
+ return generate_epoch(param)
66
+ else:
67
+ return int(param)
68
+ return None
wizata_dsapi/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.1.47"
1
+ __version__ = "1.2.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wizata-dsapi
3
- Version: 1.1.47
3
+ Version: 1.2.1
4
4
  Summary: Wizata Data Science Toolkit
5
5
  Author: Wizata S.A.
6
6
  Author-email: info@wizata.com
@@ -1,4 +1,4 @@
1
- wizata_dsapi/__init__.py,sha256=jOK2qWpsV3sTdcG9gGgl9Pt_Zj4Vy-6PE4PykYWPcAM,1876
1
+ wizata_dsapi/__init__.py,sha256=4yjQDC652yIQAcA0zc8zdoiWfmVoRpn7MRCnupXcSGw,1969
2
2
  wizata_dsapi/api_config.py,sha256=CkEmEZYNKqtnzZRHH5O4QW3O4MtoOJHoghh7ZsOokEc,5073
3
3
  wizata_dsapi/api_dto.py,sha256=-NdaTRvw5jW5xFGpIhY8U0-SdvzW2t6QD26y0UPApU0,2238
4
4
  wizata_dsapi/api_interface.py,sha256=DURk-0ey16T8sV5e2Y2G_YybPEusJvZuY0oD5L7AnXo,10903
@@ -7,7 +7,7 @@ wizata_dsapi/business_label.py,sha256=u0TVfUNfoR9qSv8lzpf6rNjlg3G9xTiz6itefcKfea
7
7
  wizata_dsapi/context.py,sha256=M7hsvXoU0Bn_5ONDB-5VvjriMpno6bAgh0RrJ9Y-h7U,11600
8
8
  wizata_dsapi/dataframe_toolkit.py,sha256=KRlvYUiyLVntMdmlK4IEB-ffC1vgNl_0a-ZpUnncb9Y,8966
9
9
  wizata_dsapi/datapoint.py,sha256=jH8yLqr78XO7pSr1a4P8kmtFvpY0_0c16xyRi9OgZAQ,12677
10
- wizata_dsapi/datastore.py,sha256=mBz0UCgoUNrabO1JYtXKN-ezqIQm79vLdN2SeiHfXds,2662
10
+ wizata_dsapi/datastore.py,sha256=BSHZmCSJ679boBA1eCkaWGJCy1CUeipKKGt2jDHzdVo,2663
11
11
  wizata_dsapi/ds_dataframe.py,sha256=Sk2JRUuTRJzko3HosJnbK34STpgSJUlqxLq8w_E5VM4,2089
12
12
  wizata_dsapi/dsapi_json_encoder.py,sha256=EhY1NA3-UQJ3HFYYbe7bvXb8NuhOvHVMJvXyGvX_T3k,2772
13
13
  wizata_dsapi/evaluation.py,sha256=kB61SD66uRBBbKqiES7XZERn77bwhacbyufneSD4s8c,2222
@@ -26,12 +26,12 @@ wizata_dsapi/plot.py,sha256=SPGKFWWYNcRvHcqvvnPIIIBKsd5UwhdsxLW7b2dG2rs,2360
26
26
  wizata_dsapi/request.py,sha256=Uqn03M6mUct6FQ4kj5A0SwX8g0vA8rM2W3EyWUvadqA,23159
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
- wizata_dsapi/streamlit_utils.py,sha256=J4g_wBh-SkNe6o9Wt60RrPgFrzay9TrTWFQq81_0k8k,520
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
32
  wizata_dsapi/twin.py,sha256=OFDFg2CsTxOUOVOf6kkDUEK9A3ED7yuPpN9TqodGruo,6581
33
33
  wizata_dsapi/twinregistration.py,sha256=Mi6-YuwroiEXc0c1hgrOaphh4hNVoHupxOnXedVtJtE,13377
34
- wizata_dsapi/version.py,sha256=iUeSKbYGjqNDS60TdIEBJ1H7dKSMf3a2gEwstNNlxig,23
34
+ wizata_dsapi/version.py,sha256=Mlm4Gvmb_6yQxwUbv2Ksc-BJFXLPg9H1Vt2iV7wXrA4,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.1.47.dist-info/LICENSE.txt,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
46
- wizata_dsapi-1.1.47.dist-info/METADATA,sha256=g1jByQVpJoEcAFZE7Tgr1QPwUcaYE3KFO4tuiUFXdGc,2188
47
- wizata_dsapi-1.1.47.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
48
- wizata_dsapi-1.1.47.dist-info/top_level.txt,sha256=-OeTJbEnh5DuWyTOHtvw0Dw3LRg3G27TNS6W4ZtfwPs,13
49
- wizata_dsapi-1.1.47.dist-info/RECORD,,
45
+ wizata_dsapi-1.2.1.dist-info/LICENSE.txt,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
46
+ wizata_dsapi-1.2.1.dist-info/METADATA,sha256=qbz8YZHV6ObUSSYpBaun7ORtPVigHDRh5W0LUztjn6Y,2187
47
+ wizata_dsapi-1.2.1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
48
+ wizata_dsapi-1.2.1.dist-info/top_level.txt,sha256=-OeTJbEnh5DuWyTOHtvw0Dw3LRg3G27TNS6W4ZtfwPs,13
49
+ wizata_dsapi-1.2.1.dist-info/RECORD,,