By ATS Staff
Data Science Python Programming Software Development Web ServerIn the world of data science and machine learning, sharing insights and deploying models efficiently is just as important as building them. However, creating interactive web applications traditionally required knowledge of front-end frameworks like Flask, Django, or React. Streamlit changes that by allowing data scientists and developers to build beautiful, interactive web apps using just Python—with no web development experience needed.
Streamlit is an open-source Python library that enables users to create and share custom web applications for machine learning and data science projects in minutes. It simplifies the process of turning data scripts into interactive dashboards, visualization tools, and even AI-powered apps.
Installing Streamlit is as simple as running:
pip install streamlit
Create a file app.py
and add the following code:
import streamlit as st st.title("My First Streamlit App") st.write("Hello, Streamlit!")
Run the app with:
streamlit run app.py
A new browser window will open, displaying your app.
Streamlit makes it easy to add text, headers, and Markdown:
st.title("Title") st.header("Header") st.subheader("Subheader") st.markdown("**Bold** and *italic* text")
Streamlit provides various widgets for user interaction:
# Slider age = st.slider("Select your age", 0, 100, 25) # Button if st.button("Click me"): st.write("Button clicked!") # Checkbox if st.checkbox("Show details"): st.write("Details revealed!") # Dropdown option = st.selectbox("Choose an option", ["A", "B", "C"])
You can embed plots from Matplotlib, Plotly, Altair, and more:
import pandas as pd import matplotlib.pyplot as plt data = pd.DataFrame({"x": [1, 2, 3], "y": [4, 5, 6]}) st.line_chart(data) # Using Matplotlib fig, ax = plt.subplots() ax.plot(data["x"], data["y"]) st.pyplot(fig)
Streamlit allows users to upload files (CSV, images, etc.):
uploaded_file = st.file_uploader("Upload a CSV file") if uploaded_file: data = pd.read_csv(uploaded_file) st.write(data.head())
Organize your app with columns and expanders:
col1, col2 = st.columns(2) with col1: st.write("Left column") with col2: st.write("Right column") with st.expander("See details"): st.write("Hidden content here!")
Once your app is ready, you can deploy it using:
For example, to deploy on Streamlit Cloud:
✅ Rapid prototyping – Go from script to app in minutes.
✅ No front-end knowledge needed – Pure Python.
✅ Great for ML & Data Science – Perfect for model demos and dashboards.
✅ Highly customizable – Themes, layouts, and interactive elements.
Streamlit is revolutionizing how data scientists and developers build and share applications. With its simple syntax, powerful features, and seamless deployment, it eliminates the need for complex web frameworks while still delivering professional-quality apps. Whether you're visualizing data, showcasing a machine learning model, or building an internal tool, Streamlit makes it fast, easy, and fun.