Metadata-Version: 2.1
Name: streamlit_stacker
Version: 0.0.2
Summary: Tool allowing to stack streamlit commands and resolve them in a controlable manner.
Home-page: https://github.com/B4PT0R/streamlit_stacker
Author: Baptiste Ferrand
Author-email: bferrand.maths@gmail.com
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: streamlit>=1.30.0
Requires-Dist: streamlit_modal_input
Requires-Dist: streamlit_pdf_reader


# 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

```bash
$ pip install streamlit_stacker
```

## Usage

```python
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.
