DataPython

Streamlit Data Dashboard

Pure-Python data app: upload a CSV or explore sample data with Plotly charts and metrics.

Open in builder →

7 steps

Shell

Shown with defaults: npm, pip, Node LTS, Python 3.12 and the template's default add-ons.

  1. 1. Check Python 3.12

    runtime

    Make sure Python 3 is installed. Python 3.12 is recommended for this stack.

    bash
    python3 --version
    Expected result
    Prints Python 3.x.
    Verify
    python3 -c "import sys; assert sys.version_info >= (3, 9); print(sys.version)"
    OS notes
    Install from python.org, `brew install python@3.12` (macOS), `sudo apt install python3 python3-venv` (Debian/Ubuntu), or `pyenv install 3.12`. On Windows the `py` launcher comes with the python.org installer.
  2. 2. Create the project folder

    template

    Create an empty folder for the project and move into it. All following commands run inside it.

    bash
    mkdir nvx-datacd nvx-data
    Expected result
    You are inside ./nvx-data
    Verify
    pwd
  3. 3. Create and activate a virtual environment

    template

    A virtual environment (.venv) keeps this project's Python packages isolated from the system Python.

    bash
    python3 -m venv .venvsource .venv/bin/activate
    Expected result
    Your prompt shows (.venv) and `python` points inside .venv.
    Verify
    python -c "import sys; print(sys.prefix)"
    OS notes
    Debian/Ubuntu may need: sudo apt install python3-venv. On Windows, if activation is blocked run: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
  4. 4. Install Streamlit, pandas and Plotly

    template

    Streamlit turns Python scripts into web apps; pandas and Plotly handle data and charts.

    bash
    python -m pip install streamlit pandas plotly
    Expected result
    `streamlit version` prints a version.
    Verify
    streamlit version
  5. 5. Pin dependencies in requirements.txt

    template

    Freeze the exact installed versions so teammates, CI and Docker install the same packages.

    bash
    python -m pip freeze > requirements.txt
    Expected result
    requirements.txt lists pinned packages (name==version).
    Verify
    cat requirements.txt
  6. 6. Write app.py

    template

    Sidebar controls, metrics, a line chart and a data table — re-runs on every interaction.

    Files written by this step: app.py
    app.py
    import numpy as np
    import pandas as pd
    import plotly.express as px
    import streamlit as st
    
    st.set_page_config(page_title="nvx-data", layout="wide")
    st.title("nvx-data - data dashboard")
    
    uploaded = st.sidebar.file_uploader("Upload a CSV (optional)", type="csv")
    days = st.sidebar.slider("Days of sample data", 7, 90, 30)
    
    if uploaded is not None:
        df = pd.read_csv(uploaded)
        st.subheader("Your data")
        st.dataframe(df)
        numeric = df.select_dtypes("number").columns.tolist()
        if numeric:
            column = st.selectbox("Column to chart", numeric)
            st.plotly_chart(px.histogram(df, x=column))
    else:
        rng = np.random.default_rng(42)
        df = pd.DataFrame({
            "day": pd.date_range("2026-01-01", periods=days),
            "signups": rng.integers(20, 120, days),
        })
        df["total"] = df["signups"].cumsum()
        left, right = st.columns(2)
        left.metric("Total signups", int(df["total"].iloc[-1]))
        right.metric("Average per day", round(float(df["signups"].mean()), 1))
        st.plotly_chart(px.line(df, x="day", y="total", title="Cumulative signups"))
        st.dataframe(df)
    
    Expected result
    app.py exists.
    Verify
    python -m py_compile app.py
  7. 7. Run the dashboard

    templaterun manually · dev server

    Starts a local server and opens the browser.

    bash
    streamlit run app.py
    Expected result
    http://localhost:8501 shows the dashboard.
    Verify
    curl -I http://localhost:8501