Intro to Streamlit

Categories: cheatsheet

Streamlit is a useful framework for building interaction python apps.

Streamlit apps are python scripts that run from top to bottom.

Here is the code to display something in the app.

import streamlit as st
st.write('Hello, world!')

Streamlit Hello

Displaying options

Displaying Data

json Streamlit Json

dataframe Streamlit dataframe

Displaying Media

Chart Streamlit Chart

Image Streamlit Image

Video Streamlit Video

Interactive Widgets

It supports:

  • button / checkbox
  • select/ multiselect / slider
  • text/numberic input / date
  • file uploader

Everything is as simple as

color = st.color_picker('Pick A Color', '#00f900')
st.write('The current color is', color)

Apps can be run using

streamlit run test.py

Here is a simple streamlit app that I build that displays a multi page app.

The Apps displaying an interactive machine learning and visualization dashboard.

Machine Learning DEmo

Complete App in Action Demo in Action