wizata-dsapi 1.1.48__py3-none-any.whl → 1.2.2__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, get_streamlit_from, get_streamlit_to
48
+ from .streamlit_utils import (get_streamlit_token, get_streamlit_domain, get_streamlit_from, get_streamlit_to,
49
+ get_streamlit_twin_id)
@@ -260,7 +260,8 @@ def generate_epoch(formatted_string: str, now=None):
260
260
  else:
261
261
  timestamp = now
262
262
 
263
- epoch = datetime.utcfromtimestamp(0)
263
+ epoch = datetime(1970, 1, 1, tzinfo=timezone.utc) # aware
264
+ timestamp = timestamp.astimezone(timezone.utc)
264
265
  timestamp_ms = int((timestamp - epoch).total_seconds() * 1000)
265
266
  return timestamp_ms
266
267
 
@@ -1,4 +1,8 @@
1
1
  import sys
2
+ import uuid
3
+ from typing import Optional
4
+ from uuid import UUID
5
+
2
6
  from .dataframe_toolkit import generate_epoch
3
7
 
4
8
 
@@ -8,6 +12,7 @@ def get_streamlit_token():
8
12
  if st.query_params is not None and "auth_token" in st.query_params:
9
13
  auth_token = st.query_params["auth_token"]
10
14
  return auth_token
15
+ return None
11
16
 
12
17
 
13
18
  def get_streamlit_domain():
@@ -16,9 +21,22 @@ def get_streamlit_domain():
16
21
  if st.query_params is not None and "dsapi" in st.query_params:
17
22
  domain = st.query_params["dsapi"]
18
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
19
37
 
20
38
 
21
- def get_streamlit_from() -> int:
39
+ def get_streamlit_from() -> Optional[int]:
22
40
  """
23
41
  timestamp representation of from parameter on UI (ms)
24
42
  :return:
@@ -31,9 +49,10 @@ def get_streamlit_from() -> int:
31
49
  return generate_epoch(param)
32
50
  else:
33
51
  return int(param)
52
+ return None
34
53
 
35
54
 
36
- def get_streamlit_to() -> int:
55
+ def get_streamlit_to() -> Optional[int]:
37
56
  """
38
57
  timestamp representation of to parameter on UI (ms)
39
58
  :return:
@@ -46,3 +65,4 @@ def get_streamlit_to() -> int:
46
65
  return generate_epoch(param)
47
66
  else:
48
67
  return int(param)
68
+ return None
wizata_dsapi/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.1.48"
1
+ __version__ = "1.2.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wizata-dsapi
3
- Version: 1.1.48
3
+ Version: 1.2.2
4
4
  Summary: Wizata Data Science Toolkit
5
5
  Author: Wizata S.A.
6
6
  Author-email: info@wizata.com
@@ -1,11 +1,11 @@
1
- wizata_dsapi/__init__.py,sha256=48UjO8KBAwRHWtv4yX_9SGtnFaBuPjKyRLE6kTpDI88,1914
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
5
5
  wizata_dsapi/bucket.py,sha256=Zz9olv-pymikAutGitSuGWrAPiawOTW86JDDHG4ugTc,1150
6
6
  wizata_dsapi/business_label.py,sha256=u0TVfUNfoR9qSv8lzpf6rNjlg3G9xTiz6itefcKfeak,4151
7
7
  wizata_dsapi/context.py,sha256=M7hsvXoU0Bn_5ONDB-5VvjriMpno6bAgh0RrJ9Y-h7U,11600
8
- wizata_dsapi/dataframe_toolkit.py,sha256=KRlvYUiyLVntMdmlK4IEB-ffC1vgNl_0a-ZpUnncb9Y,8966
8
+ wizata_dsapi/dataframe_toolkit.py,sha256=22H4SizmhTQ1DNIzd6tg0izgncRDcrdkfGdBO6Vbi5g,9039
9
9
  wizata_dsapi/datapoint.py,sha256=jH8yLqr78XO7pSr1a4P8kmtFvpY0_0c16xyRi9OgZAQ,12677
10
10
  wizata_dsapi/datastore.py,sha256=BSHZmCSJ679boBA1eCkaWGJCy1CUeipKKGt2jDHzdVo,2663
11
11
  wizata_dsapi/ds_dataframe.py,sha256=Sk2JRUuTRJzko3HosJnbK34STpgSJUlqxLq8w_E5VM4,2089
@@ -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=QaiDy1iEQtWBlKleuPcV6HgACjmKxeh88cVfPpwztAA,1432
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=hIiM026mwgCs1VUQGyl9dPEuinxGLrAL5pZxw0wOXgk,23
34
+ wizata_dsapi/version.py,sha256=uuf4VNtTNA93fMhoAur9YafzaKJFnczY-H1SSCSuRVQ,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.48.dist-info/LICENSE.txt,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
46
- wizata_dsapi-1.1.48.dist-info/METADATA,sha256=3beZdZ8bZk6owfYG-QyieskB2NN5rr9Kv9WSm8M8cq4,2188
47
- wizata_dsapi-1.1.48.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
48
- wizata_dsapi-1.1.48.dist-info/top_level.txt,sha256=-OeTJbEnh5DuWyTOHtvw0Dw3LRg3G27TNS6W4ZtfwPs,13
49
- wizata_dsapi-1.1.48.dist-info/RECORD,,
45
+ wizata_dsapi-1.2.2.dist-info/LICENSE.txt,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
46
+ wizata_dsapi-1.2.2.dist-info/METADATA,sha256=_WJlwzUyvWJZ_3MRO9gfS6qMPD2ctlM7c63Vv1RKTQY,2187
47
+ wizata_dsapi-1.2.2.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
48
+ wizata_dsapi-1.2.2.dist-info/top_level.txt,sha256=-OeTJbEnh5DuWyTOHtvw0Dw3LRg3G27TNS6W4ZtfwPs,13
49
+ wizata_dsapi-1.2.2.dist-info/RECORD,,