liveBook · Manning

Streamlit

As explained in DuckDB in Action

Streamlit is an open-source Python framework for building interactive data and machine-learning applications.

Streamlit is a Python framework for building interactive web applications for data and machine-learning workflows. It uses a code-first model: declare Python components, connect familiar libraries, and let Streamlit render the interface without requiring JavaScript frontend code. section 9.1.1 section 9.3

A practical Streamlit data app can combine:

  • A Python script such as app.py as the application canvas for titles, text, widgets, charts, and tables. section 9.1.2
  • DuckDB through its Python package, including read-only access to an embedded database in the same process. section 9.1.2
  • Reusable components such as search boxes, columns, and dataframes instead of hand-written HTML and JavaScript. section 9.1.3
  • Python libraries including pandas, scikit-learn, matplotlib, and DuckDB for data processing and visualization. section 9.1.1

ATP head-to-head application

A compact application searches player names in an ATP matches table, lets users choose two players, queries their matches, counts wins, and displays the results. Start with `import streamlit as st`, configure a wide layout, and run the script with `streamlit run app.py`. Add `st.columns(2)` and `st_searchbox(search_players, ...)` for two player selectors, then pass the selections into a parameterized DuckDB query and render the returned DataFrame with `st.dataframe(...)`. section 9.1.2 section 9.1.3

Figure 9.1 ATP database schema
figure

Use the ATP database schema to trace the tables joined by the application when retrieving match history and player statistics. section 9.1

How DuckDB in Action covers it

How deep it goes
Explains installation, app structure, database connection, components, queries, and rendering, while deferring broader chart design.
Examples
Demonstrates an ATP player-search app with DuckDB queries, two search boxes, win counts, and a match-results table.
What it assumes
Uses Python and a DuckDB database, while teaching the Streamlit interface and components from installation onward.
What you can do after
Build it from scratch, launch it locally, connect DuckDB, add interactive inputs, and render query results.
How it connects
Connects Python, DuckDB, pandas, DataFrames, machine learning, Plotly, and Apache Superset.

Also explained in

Compare how 9 books explain Streamlit →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of DuckDB in Action. The section links point to the parts of the book it draws on.