Skip to content

Instantly share code, notes, and snippets.

View the-marlabs's full-sized avatar

Vishal Gupta the-marlabs

View GitHub Profile
@okld
okld / multipage_settings_app.py
Last active May 21, 2024 15:33
Streamlit - Settings page with session state
import streamlit as st
from persist import persist, load_widget_state
def main():
if "page" not in st.session_state:
# Initialize session state.
st.session_state.update({
# Default page.
"page": "home",
@tvst
tvst / st_state_patch.py
Last active January 21, 2024 18:31
DO NOT USE!!! Try st.session_state instead.
"""Another prototype of the State implementation.
Usage
-----
How to import this:
import streamlit as st
import st_state_patch
@tvst
tvst / SessionState.py
Last active April 14, 2024 20:24
DO NOT USE!!! Try st.session_state instead.
"""Hack to add per-session state to Streamlit.
Usage
-----
>>> import SessionState
>>>
>>> session_state = SessionState.get(user_name='', favorite_color='black')
>>> session_state.user_name
''