Tool allowing to stack streamlit commands and resolve them in a controlable manner.
Project description
streamlit_stacker
streamlit_stacker is a python package implementing a main st_stacker class. This class can be used with similar syntax as the streamlit module but the calls to commands will be stacked and rendered latter in a controlable manner.
Useful to implement dynamic execution of streamlit commands in an interactive console interface. Supports (almost) all streamlit methods
Installation
$ pip install streamlit_stacker
Usage
import streamlit as st
from streamlit_stacker import st_stacker
#shortcut
state=st.session_state
#define the stacker in state
if not 'stacker' in state:
state.stacker=st_stacker()
stk=state.stacker
#resets all commands in the stacker to a non-rendered state, so that the next call to refresh will render them again
stk.reset()
if not 'test' in state:
#stack a chat message, won't be rendered immediately
with stk.chat_message():
stk.write("Hello!")
state.test=True
#render the stack: the chat message will appear on screen on every rerun, even though the corresponding commands have been called only once at first run
stk.refresh()
License
This project is licensed. Please see the LICENSE file for more details.
Contributions
Contributions are welcome. Please open an issue or a pull request to suggest changes or additions.
Contact
For any questions or support requests, please contact Baptiste Ferrand at the following address: bferrand.maths@gmail.com.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file streamlit_stacker-0.0.2.tar.gz
.
File metadata
- Download URL: streamlit_stacker-0.0.2.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b2da84375229d17ec87eb6a3cc1fe0a8bf9ab9e33eec15d2365580974932c17 |
|
MD5 | 616d55832de41e6fa900f97c7b65c497 |
|
BLAKE2b-256 | 9acc66d5a7fd40d9d500c99605ad4f25bb467f7e2012b18837df77ee9ef5d912 |
File details
Details for the file streamlit_stacker-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: streamlit_stacker-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf950a536e02c06790884f1256ca4d85ac5825d4f1c39b7692e5ade39d5d296b |
|
MD5 | de80510a4f5774d2f1c5c9f225572677 |
|
BLAKE2b-256 | a9e384509072dd8c97a4ede446e02445bf9035ce81e1fddd1d0d8b4c8e55008c |