Site icon andrewm4894

streamlit multi-page app minimal example

too obvious? maybe. probably.

Recently i had a need to assess streamlit for some internal DS/ML/Data apps i wanted to build in my job. By “i had a need” i mean i heard it was the new cool thing so i wanted to play with it and feel better about myself. Anyway, as part of that i built a horribly useless app to try capture the main things i was after.

In the end i went with Dash instead (mainly due to needing tabs and some additional messy ‘state’ related stuff i could find lots of dash examples for) but i’m pretty sure next time i need to do something similar i will 100% use streamlit as my goto given its just so easy to get going with and should be more than acceptable for 80-90% of my use cases (plus its got a lot of momentum and is getting better and better over time).

So in this post i am sharing a little cleaned up version of the dummy streamlit app i built as a little poc to see if i could get what i needed from it. Also, a few student’s in the course where i mentor have been playing with streamlit as part of building an app to share and publish their ml models so i’m hoping this might be useful to refer them too as a potential starting point (although there are many many much cleaner examples in the streamlit gallery). But if you want some of the features below then my little frankenstein here might be an ok starting point for you.

TL; DR – Here is the app running on streamlit share: https://share.streamlit.io/andrewm4894/streamlit-learn/main/app.py and here is the code on Github.

Project structure

Here is how the project is structured and below are some notes on each folder or file.

project tree structure

Here are each of the main folders/files and what they do.

That’s it, you can look at the code and see it all for yourself, i’ve also added a README to each folder to make it as clear as possible (some potential todo’s that could make it a better example).

Lastly, here is a pointless video of me clicking some stuff…

Exit mobile version