utility functions to retrieve context parameters when running inside a Wizata Streamlit application. These functions read query parameters passed by the platform to your Streamlit app.
Functions
get_streamlit_domain()
get the Wizata API domain configured for the current Streamlit session.
return: domain string.
get_streamlit_token()
get the authentication token for the current Streamlit session.
return: token string.
get_streamlit_from()
get the "from" timestamp selected on the Wizata UI.
return: timestamp in milliseconds (int) or None if not set.
get_streamlit_to()
get the "to" timestamp selected on the Wizata UI.
return: timestamp in milliseconds (int) or None if not set.
get_streamlit_twin_id()
get the currently selected twin UUID from the Wizata UI.
return: uuid.UUID or None if not set.
Example
import wizata_dsapi
from datetime import datetime, timezone
domain = wizata_dsapi.get_streamlit_domain()
token = wizata_dsapi.get_streamlit_token()
twin_id = wizata_dsapi.get_streamlit_twin_id()
ts_from = wizata_dsapi.get_streamlit_from()
ts_to = wizata_dsapi.get_streamlit_to()
if ts_from is not None:
dt_from = datetime.fromtimestamp(ts_from / 1000, tz=timezone.utc)