What is Streamlit?
Streamlit is an open-source Python library for building dashboards, data tools, and AI demos. It is especially useful when you want to share a notebook-like workflow with non-technical users. You can use it to create:- AI chat interfaces
- Data dashboards
- Simple internal business tools
- Prototype applications for machine learning projects
Streamlit architecture
Streamlit follows a simple client-server model:- Your Python script runs on the server.
- The browser shows the interface.
- When a user interacts with a widget, the browser sends a new event to the server.
- Streamlit reruns the script to refresh the page with the latest values.
Execution flow
Streamlit uses a rerun model. Every time a user clicks a button, types in a field, or changes a slider, the script runs again from top to bottom. This makes the app feel reactive and keeps the UI in sync.Creating and running an application
Create a file such asapp.py and run it from your terminal:
http://localhost:8501, and opens your app in the browser.
Project structure
A simple Streamlit project often contains:app.pyfor the main app logicdata/for CSV or JSON filesimages/for local media filespages/for multipage apps
A practical learning path
The Streamlit module is organized into five beginner-friendly sections:Displaying content
Render text, tables, images, and status messages
User input widgets
Collect text, selections, files, and dates
Layouts and interactivity
Organize your app with sidebars, tabs, and forms
Working with data
Load CSV files, filter rows, and visualize data