Streamlit
Builds interactive data applications from Python scripts.
- Downloads / mo
- 23.9M
- Stars
- 46.4K
- Last release
- 1.67.0
- License
- Apache-2.0
Strengths
- Builds interfaces from Python scripts. Add interactive data tables, charts, and controls to a Python script.
- Caches reusable data and resources. Keep expensive results or shared resource objects across script reruns.
- Includes dataframe CSV downloads. Let users export the displayed data table as CSV.
Limitations
- Interactions can rerun the script. Cache expensive work when default full-script reruns repeat too much computation.
- Shared resources need thread safety. Keep globally cached clients and models thread safe across concurrent user sessions.
Quickstart
import streamlit as st x = st.slider("Select a value") st.write(x, "squared is", x * x)
Streamlit examples
@st.cache_data(ttl="2h") def load_data(uploaded_file): try: ext = os.path.splitext(uploaded_file.name)[1][1:].lower() except: ext = uploaded_file.split(".")[-1] if ext in file_formats: return file_formats[ext](uploaded_file) else: st.error(f"Unsupported file format: {ext}") return None