# gavo46/whatwouldtheyplay architecture

> Architecture diagram of the GitHub repository gavo46/whatwouldtheyplay, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gavo46/whatwouldtheyplay
- Repository: https://github.com/gavo46/whatwouldtheyplay

## Overview

What Would They Play? is a Streamlit app that estimates whether a song will be played at the next Dave Matthews Band show. Its main workflow is a user-facing prediction over scraped historical setlist data; the model applies different probability treatments for retired, rare, newly debuted, and established songs. A separate scraping workflow discovers eligible show pages and extracts song/setlist data. The app and model implementation were not excerpted, so their connection is shown as unverified; other links rely on the README or sampled scraper code.

Main entry points: [`necessary/.streamlit/predict.py`](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/.streamlit/predict.py) (Prediction logic), [`necessary/allshows.csv`](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/allshows.csv) (Historical setlists), [`necessary/.streamlit/web.py`](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/.streamlit/web.py) (Streamlit interface), [`necessary/urlscrape.py`](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/urlscrape.py) (Show URL scraper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Prediction app"]
  node_web["Streamlit interface<br/>[web.py]"]
  node_estimate["Song estimate"]
end

subgraph group_model["Probability model"]
  node_predict["Prediction logic<br/>[predict.py]"]
  node_retired["Retired filter<br/>[predict.py]"]
  node_rare["Rare-song estimate<br/>[predict.py]"]
  node_debut["Debut estimate<br/>[predict.py]"]
  node_cycle["Cycle estimate<br/>[predict.py]"]
end

subgraph group_scrape["Setlist collection"]
  node_year_scraper["Show URL scraper<br/>[urlscrape.py]"]
  node_setlist_scraper["Setlist scraper<br/>[scrape.py]"]
end

subgraph group_data["Historical data"]
  node_show_urls[("Show URL list<br/>[showurls.csv]")]
  node_show_data[("Historical setlists<br/>[allshows.csv]")]
  node_other_data[("Additional setlists<br/>[othershows.csv]")]
  node_cleanup["Setlist cleanup<br/>[strippartial.py]"]
end

node_fan(("DMB fan"))
node_almanac["DMBAlmanac"]

node_fan -->|"requests prediction"| node_web
node_web -.->|"requests estimate"| node_predict
node_predict -.->|"produces"| node_estimate
node_predict -.->|"filters"| node_retired
node_predict -.->|"estimates"| node_rare
node_predict -.->|"estimates"| node_debut
node_predict -.->|"estimates"| node_cycle
node_show_data -->|"informs model"| node_predict
node_almanac -->|"serves show pages"| node_year_scraper
node_year_scraper -->|"writes URLs"| node_show_urls
node_almanac -->|"serves setlists"| node_setlist_scraper
node_setlist_scraper -->|"appends rows"| node_other_data
node_show_data -->|"reads data"| node_cleanup
node_cleanup -->|"rewrites data"| node_show_data

click node_web "https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/.streamlit/web.py"
click node_predict "https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/.streamlit/predict.py"
click node_retired "https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/.streamlit/predict.py"
click node_rare "https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/.streamlit/predict.py"
click node_debut "https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/.streamlit/predict.py"
click node_cycle "https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/.streamlit/predict.py"
click node_year_scraper "https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/urlscrape.py"
click node_show_urls "https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/showurls.csv"
click node_setlist_scraper "https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/scrape.py"
click node_show_data "https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/allshows.csv"
click node_other_data "https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/othershows.csv"
click node_cleanup "https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/strippartial.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_estimate toneBlue
class node_predict,node_retired,node_rare,node_debut,node_cycle toneAmber
class node_year_scraper,node_setlist_scraper toneMint
class node_show_urls,node_show_data,node_other_data,node_cleanup toneRose
class node_fan,node_almanac toneIndigo
```

## Components

### Prediction app

- [Streamlit interface](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/.streamlit/web.py): `necessary/.streamlit/web.py`
- **Song estimate**

### Probability model

- [Prediction logic](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/.streamlit/predict.py): `necessary/.streamlit/predict.py`
- [Retired filter](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/.streamlit/predict.py): `necessary/.streamlit/predict.py`
- [Rare-song estimate](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/.streamlit/predict.py): `necessary/.streamlit/predict.py`
- [Debut estimate](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/.streamlit/predict.py): `necessary/.streamlit/predict.py`
- [Cycle estimate](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/.streamlit/predict.py): `necessary/.streamlit/predict.py`

### Setlist collection

- [Show URL scraper](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/urlscrape.py): `necessary/urlscrape.py`
- [Setlist scraper](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/scrape.py): `necessary/scrape.py`

### Historical data

- [Show URL list](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/showurls.csv): `necessary/showurls.csv`
- [Historical setlists](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/allshows.csv): `necessary/allshows.csv`
- [Additional setlists](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/othershows.csv): `necessary/othershows.csv`
- [Setlist cleanup](https://github.com/gavo46/whatwouldtheyplay/blob/main/necessary/strippartial.py): `necessary/strippartial.py`

### Other components

- **DMB fan**
- **DMBAlmanac**

## Connections

- DMB fan → Streamlit interface: requests prediction (evidence: `README.md`)
- Streamlit interface → Prediction logic: requests estimate
- Prediction logic → Song estimate: produces
- Prediction logic → Retired filter: filters
- Prediction logic → Rare-song estimate: estimates
- Prediction logic → Debut estimate: estimates
- Prediction logic → Cycle estimate: estimates
- Historical setlists → Prediction logic: informs model (evidence: `README.md`)
- DMBAlmanac → Show URL scraper: serves show pages (evidence: `necessary/urlscrape.py`)
- Show URL scraper → Show URL list: writes URLs (evidence: `necessary/urlscrape.py`)
- DMBAlmanac → Setlist scraper: serves setlists (evidence: `necessary/scrape.py`)
- Setlist scraper → Additional setlists: appends rows (evidence: `necessary/scrape.py`)
- Historical setlists → Setlist cleanup: reads data (evidence: `necessary/strippartial.py`)
- Setlist cleanup → Historical setlists: rewrites data (evidence: `necessary/strippartial.py`)
