STREAMLIT APP
STRUCTURE & BASICS
QUICK GUIDETO BUILDING INTERACTIVEWEB APPS
www.accentfuture.com
WHAT IS STREAMLIT?
• Open-source Python library
• Quickly create interactive web apps for data science and machine learning
• Focused on simplicity and rapid development
KEY FEATURES OF STREAMLIT
• Easy to use: pure Python
• No front-end experience required
• Widgets for interactivity (buttons, sliders, inputs)
• Hot-reloading on save
• Deploy easily to the cloud
BASIC STREAMLIT APP STRUCTURE
-python
import streamlit as st
st.title("My First Streamlit App")
st.write("Hello, Streamlit!")
• Always start by importing Streamlit
• Use Streamlit functions to create UI elements
COMMON STREAMLIT ELEMENTS
- `st.title()`
- `st.header()`
- `st.subheader()`
- `st.text()` / `st.markdown()`
- `st.write()`
- `st.dataframe()`
- `st.metric()`
ADDING INTERACTIVITY
- Widgets examples:
- `st.button("Click Me")`
- `st.slider("Select a number", 0, 100)`
- `st.text_input("Enter your name")`
Widgets return values you can use
STREAMLIT LAYOUT OPTIONS
- Containers: `st.container()`
- Columns: `st.columns()`
- Expanders: `st.expander()`
- Sidebar: `st.sidebar`
EXAMPLE - SIMPLE INTERACTIVE APP
-python
name = st.text_input("What's your name?")
if st.button("Greet"): st.write(f"Hello, {name}!")
- Live feedback from user inputs
HOW STREAMLIT RUNS
• Script is re-run from top to bottom on any interaction
• State is handled internally
• Use `st.session_state` for complex apps
BEST PRACTICES
• Keep code simple and modular
• Use functions to organize code
• Minimize use of global variables
• Use caching with `@st.cache_data` or `@st.cache_resource`
DEPLOYING STREAMLIT APPS
• Streamlit Community Cloud
• AWS, GCP,Azure (via containers orVMs)
• Share apps easily with a public link
SUMMARY
• Streamlit = Easy, Fast, Powerful
• Great for prototyping and sharing ML/data science projects
• Practice by building mini projects!
CONTACT DETAILS
👉 Enroll Now: www.accentfuture.com
📩 Email: contact@accentfuture.com
📞 Call: +91-9640001789
StreamlitTraining

Streamlit App Structure & Basics - AccentFuture

  • 1.
    STREAMLIT APP STRUCTURE &BASICS QUICK GUIDETO BUILDING INTERACTIVEWEB APPS www.accentfuture.com
  • 2.
    WHAT IS STREAMLIT? •Open-source Python library • Quickly create interactive web apps for data science and machine learning • Focused on simplicity and rapid development
  • 3.
    KEY FEATURES OFSTREAMLIT • Easy to use: pure Python • No front-end experience required • Widgets for interactivity (buttons, sliders, inputs) • Hot-reloading on save • Deploy easily to the cloud
  • 4.
    BASIC STREAMLIT APPSTRUCTURE -python import streamlit as st st.title("My First Streamlit App") st.write("Hello, Streamlit!") • Always start by importing Streamlit • Use Streamlit functions to create UI elements
  • 5.
    COMMON STREAMLIT ELEMENTS -`st.title()` - `st.header()` - `st.subheader()` - `st.text()` / `st.markdown()` - `st.write()` - `st.dataframe()` - `st.metric()`
  • 6.
    ADDING INTERACTIVITY - Widgetsexamples: - `st.button("Click Me")` - `st.slider("Select a number", 0, 100)` - `st.text_input("Enter your name")` Widgets return values you can use
  • 7.
    STREAMLIT LAYOUT OPTIONS -Containers: `st.container()` - Columns: `st.columns()` - Expanders: `st.expander()` - Sidebar: `st.sidebar`
  • 8.
    EXAMPLE - SIMPLEINTERACTIVE APP -python name = st.text_input("What's your name?") if st.button("Greet"): st.write(f"Hello, {name}!") - Live feedback from user inputs
  • 9.
    HOW STREAMLIT RUNS •Script is re-run from top to bottom on any interaction • State is handled internally • Use `st.session_state` for complex apps
  • 10.
    BEST PRACTICES • Keepcode simple and modular • Use functions to organize code • Minimize use of global variables • Use caching with `@st.cache_data` or `@st.cache_resource`
  • 11.
    DEPLOYING STREAMLIT APPS •Streamlit Community Cloud • AWS, GCP,Azure (via containers orVMs) • Share apps easily with a public link
  • 12.
    SUMMARY • Streamlit =Easy, Fast, Powerful • Great for prototyping and sharing ML/data science projects • Practice by building mini projects!
  • 13.
    CONTACT DETAILS 👉 EnrollNow: www.accentfuture.com 📩 Email: contact@accentfuture.com 📞 Call: +91-9640001789 StreamlitTraining