This repository includes two beginner-level examples of using Streamlit which:
Allow you to turn data scripts into shareable web apps in minutes, not weeks. It’s all Python, open-source, and free! And once you’ve created an app you can use our Community Cloud platform to deploy, manage, and share your app.
Using just Python, Streamlit allows a generation of both the back-end and the front-end of an online application or webpage. This means that by writing a few dozens lines of Python code, a developer can create an app that can be served to his colleagues at work, or to anyone across the world.
Streamlit can be limited in functionality and slow. Some of the notable limitations are its lack of design flexibility and control over the application layout. Moreover, if the application and/or dataset is large, there likely be speed issues. This is since the entire source code is being re-run on every new change or interaction.
Streamlit has proved useful for:
- Serving data analytics dashboards when a user-interaction requires a backend (for instance to serve a model).
- Presenting proof-of-concepts (POCs) of ML models
However, even with limited capabilities (compared to a backend and frontend built with e.g. Python and React), Streamlit can still allow making a large impact.
- Streamlit Gallery - presents a wide collection of Streamlit apps. This is a great resource for inspiration and to get familiar with Streamlit's capabilities and limitations by example.
- Streamlit on Twitter - a (noisy) collection of more recent apps created with Streamlit.
- Kilcommins, Medium provides a thorough and critical review of Streamlit as of February 2021 (with many of the observations still relevant as of March 2023).
- Fork or Clone. Forking will be needed to serve the app from Streamlit Cloud
- To run locally, run
python ./setup/setup.py
from the root folder of the repository (you can first read/setup/README.md
, or go into thesetup.py
to see what it is doing) - Activate the virtual environment for the app you'd like to run
- Run
streamlit run APP-FILE-NAME
from the root (where e.g.APP-FILE-NAME=./hello_world/streamlit_hello_world.py
). This will start the app locally on your laptop. To stop the app pressctrl-c
onWindows
andLinux
, orcmd-c
on Mac in the terminal from which you launched the app. - To serve the app from your own repository, go to Streamlit Cloud and follow the instructions.
- The repository includes two apps, each with its own Python package dependencies. The
Streamlit Cloud
service hosts each app independently, with its own Python environment. For multiple apps within a single repository,Streamlit Cloud
assigns an environment to an app, based on arequirements.txt
file that is in the app's folder (docs).