import streamlit as st def login(pw: str) -> bool: """ Convenience wrapper for login functionality. Has side effect of storing the logged in user name in the session state :param pw: Password to attempt login :return: True/False if logged in """ pw_users = st.secrets['app_password'].split(';') for pu in pw_users: split_point=pu.find('(') pu_password = pu[0:split_point] if pu_password == pw: pu_user = pu[split_point + 1: -1] st.session_state['username'] = pu_user return True return False def st_setup(page_title: str, layout: str = 'wide', skip_login: bool = False): """ Sets up standard outline (wide layout), checks for logged in status and then displays the login box if not logged in. Should be used as a conditional to display the other content on the page. :param page_title: The streamlit page title for this page :return: bool - logged in status """ st.set_page_config(page_title=page_title, layout=layout) username='username' if username in st.session_state: st.markdown(f'