Streamlit App Structure & Basics - AccentFuture PowerPoint PPT Presentation

presentation player overlay
About This Presentation
Transcript and Presenter's Notes

Title: Streamlit App Structure & Basics - AccentFuture


1
Streamlit App Structure Basics
  • Quick Guide to Building Interactive Web 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 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

4
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

5
Common Streamlit Elements
  • st.title()
  • st.header()
  • st.subheader()
  • st.text() / st.markdown()
  • st.write()
  • st.dataframe()
  • st.metric()

6
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

7
Streamlit Layout Options
  • Containers st.container()
  • Columns st.columns()
  • Expanders st.expander()
  • Sidebar st.sidebar

8
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
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
  • Keep code simple and modular
  • Use functions to organize code
  • Minimize use of global variables
  • Use caching with _at_st.cache_data or
    _at_st.cache_resource

11
Deploying Streamlit Apps
  • Streamlit Community Cloud
  • AWS, GCP, Azure (via containers or VMs)
  • 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
  • ?? Enroll Now www.accentfuture.com?? Email
    contact_at_accentfuture.com?? Call 91-9640001789
  • Streamlit Training
Write a Comment
User Comments (0)
About PowerShow.com