Streamlit is an opinionated library for serving models and visualizations in pure Python. It is interactive and quick to deploy.
- Create a streamlit app to serve models and visualizations
- Use plotly express to create interactive visualizations
- Deploy your streamlit on streamlit
In your terminal, list the packages in your virtual environments.
If you don't see streamlit and plotly, then install them.
pip install streamlit
pip install plotly
- Arrange your screen(s) so you can see a browser window and your text editor.
- Opne your text editor
- Navigate to the folder where you want to create your app
- Make a new python file named
my_app.py - In the file, add
import streamlit as stand save the file - In the terminal, in the same directory as your
my_app.pyfile executestreamlit run my_app.py- You are now serving your app loacally.
- You should see a browser window pop up.
- After changing your code, you can click a button at the top right of your browser to re-run the code. You can click a button in that area to tell your browser to rerun automatically after every change.
- Your code runs from top to bottom, every time.
- You can deploy your model to the internet by pushing it to your personal GitHub account and connecting it to Streamlit's servers.