Files
stand/stand.py
2022-05-23 13:42:22 +02:00

51 lines
743 B
Python

import streamlit as st
import hacks
from aggrid import aggrid
from download import download
from restapi import restapi
from utils.st_utils import get_session_id, hide_UI_elements
print(">>> start of streamlit run")
st.set_page_config(
page_title="stand",
page_icon="icon.png",
layout="wide"
)
hide_UI_elements()
restapi.sid = get_session_id() # rest api needs current session ID to trigger the next rerun
changed = restapi.changed
df = restapi.data
download(df)
response = aggrid(
df,
reload_data=changed
)
new_df = response["data"]
if not new_df.equals(df) and not changed:
restapi.data = new_df
if not new_df.empty:
new_df.to_hdf("output.h5", key="data")
print(">>> end of streamlit run")