Frankly, I feel the same, especially because Iām not a data scientist and because Iām constantly trying to bend streamlitās standard usage to fulfill particular needs.
However, the framework has so much to offer even outside the data science scope and Iām convinced itāll be able to cover more and more use cases as time goes by. That said, Streamlit is already quite useful to me. Just as @andfanilo and @Ian_Calvert said, itās a great replacement (and improvement) for jupyter notebooks and even cli apps to some extent.
Well, the Streamlit way of handling things is just like calling a command line tool with a bunch of parameters.
But as you said, thereās this issue of managing state. The current problem here is when an app reruns, you canāt access a widget value prior its declaration/execution. However Iām not sceptical on this matter. One approach Iām working on is to bind a widget to a state variable like so:
print(state.value)
st.text_input("Blabla.", state="value")
state.value = "Hello" # This assignment updates the widget's value on screen
If you interact with a widget, the whole app will rerun with an up to date state directly from the beginning. Ideally youād even be able to do something like the third line to set/update a widget value (or markdown text) without using st.empty()
: a bi-directional binding.
Iām really curious to see if something like this seems simple enough to use and could be a viable solution for state management with widgets.
You encountered the out of sync issue by doing something like this, right?
state.value = st.text_input("Blabla.", value=state.value)
If Iām right about what youāre refering to, I guess something like this should help. I know this is your typical āuse this hackā answer , but we have no other solution than using hacks or waiting for an official implementation