https://github.com/likianta/streamlit-canary
LK-flavored Streamlit enhancements.
https://github.com/likianta/streamlit-canary
Last synced: 2 months ago
JSON representation
LK-flavored Streamlit enhancements.
- Host: GitHub
- URL: https://github.com/likianta/streamlit-canary
- Owner: likianta
- Created: 2024-06-26T07:58:27.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-07-25T06:18:15.000Z (2 months ago)
- Last Synced: 2025-07-25T11:58:31.033Z (2 months ago)
- Language: Python
- Homepage:
- Size: 153 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Streamlit Canary
## Usage
### Session State
There are two code styles for accessing session data. The first is short but
the IDE may not be able to autocomplete its keys; the second is more verbose
but make IDE's autocomplete work:Style 1:
```python
import streamlit_canary as sc
if not (state := sc.session.get_state()):
state.update({'key1': 'value1', 'key2': 'value2'})
```Style 2:
```python
import streamlit_canary as sc
if not (x := sc.session.get_state( < target_version >)):
x.update(state := {'key1': 'value1', 'key2': 'value2'})
else:
state = x
```