Project Setup
Sample Dataset
Save this asstudents.csv to use while developing:
Building the App Step by Step
Step 1 — App Configuration and Title
st.set_page_config must be the first Streamlit call in your script. Setting layout="wide" makes the app span the full browser width.
Step 2 — File Upload
st.stop() prevents the rest of the script from running when no file has been uploaded, keeping the app clean for first-time visitors.
Step 3 — Top-Level Metrics
Step 4 — Sidebar Filters
st.form means the app only reruns when the user clicks Apply Filters, not on every keystroke. This is much more efficient for expensive operations.
Step 5 — Apply Filters to the Data
Step 6 — Session State for a Visit Counter
st.session_state persists values across reruns within the same browser session. Without it, the counter would reset to 0 on every rerun.
Step 7 — Tabbed Layout
Step 8 — Dataset Tab
Step 9 — Reports Tab
Step 10 — Charts Tab
Step 11 — Progress Indicator and Download
Complete App at a Glance
After completing all steps, yourapp.py produces this layout: