# donnemartin/viz architecture

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

- Interactive diagram: https://gitdiagram.com/donnemartin/viz
- Repository: https://github.com/donnemartin/viz

## Overview

Viz combines a GitHub-statistics miner with published language tables, interactive Tableau workbooks, and a companion website. The principal update path is a CLI command into the stats orchestrator, which queries GitHub, aggregates repository and account statistics, optionally geocodes user locations, and writes datasets used in the published views. The README documents the product capabilities and external services; sampled Python excerpts establish the CLI, API, and geocoding calls. Website and visualization internals are represented at supported directory paths, so their implementation-level wiring is not inferred.

Main entry points: [`githubstats/github_stats.py`](https://github.com/donnemartin/viz/blob/master/githubstats/github_stats.py) (Stats orchestrator), [`githubstats/data`](https://github.com/donnemartin/viz/tree/master/githubstats/data) (Collected datasets), [`githubstats/github_stats_cli.py`](https://github.com/donnemartin/viz/blob/master/githubstats/github_stats_cli.py) (Stats CLI), [`githubstats/lib/github.py`](https://github.com/donnemartin/viz/blob/master/githubstats/lib/github.py) (GitHub adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data collection"]
  node_cli["Stats CLI"]
  node_github["GitHub adapter<br/>[github.py]"]
end

subgraph group_processing["Processing"]
  node_stats["Stats orchestrator<br/>[github_stats.py]"]
  node_repo["Repository model<br/>[repo.py]"]
  node_user["User model<br/>[user.py]"]
  node_geocoder["Location geocoder<br/>[user_geocoder.py]"]
  node_wrangling["Data wrangling"]
end

subgraph group_outputs["Published outputs"]
  node_dataset[("Collected datasets")]
  node_tables["Language tables"]
  node_workbooks["Interactive workbooks"]
end

subgraph group_website["Website"]
  node_webcontent["Website pages"]
  node_webconfig["Site configuration<br/>[pelicanconf.py]"]
end

node_operator(("Operator"))
node_githubapi{{"GitHub API"}}
node_maps{{"Google Maps API"}}
node_tableau{{"Tableau Public"}}

node_operator -->|"runs command"| node_cli
node_cli -->|"creates and invokes"| node_stats
node_stats -->|"queries through"| node_github
node_github -->|"authenticates and queries"| node_githubapi
node_stats -->|"creates repository records"| node_repo
node_stats -->|"creates account records"| node_user
node_stats -->|"updates user locations"| node_geocoder
node_geocoder -->|"geocodes locations"| node_maps
node_stats -->|"writes CSV data"| node_dataset
node_dataset -.->|"supplies data"| node_wrangling
node_dataset -.->|"provides tracked data"| node_tables
node_dataset -.->|"feeds visualizations"| node_workbooks
node_tableau -.->|"hosts views"| node_workbooks
node_webconfig -->|"configures site"| node_webcontent

click node_cli "https://github.com/donnemartin/viz/blob/master/githubstats/github_stats_cli.py"
click node_stats "https://github.com/donnemartin/viz/blob/master/githubstats/github_stats.py"
click node_github "https://github.com/donnemartin/viz/blob/master/githubstats/lib/github.py"
click node_repo "https://github.com/donnemartin/viz/blob/master/githubstats/repo.py"
click node_user "https://github.com/donnemartin/viz/blob/master/githubstats/user.py"
click node_geocoder "https://github.com/donnemartin/viz/blob/master/githubstats/user_geocoder.py"
click node_dataset "https://github.com/donnemartin/viz/tree/master/githubstats/data"
click node_wrangling "https://github.com/donnemartin/viz/blob/master/githubstats/data_wrangling.ipynb"
click node_tables "https://github.com/donnemartin/viz/tree/master/language_stats"
click node_workbooks "https://github.com/donnemartin/viz/tree/master/viz"
click node_webcontent "https://github.com/donnemartin/viz/tree/master/site/content/pages"
click node_webconfig "https://github.com/donnemartin/viz/blob/master/site/pelicanconf.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_cli,node_github toneBlue
class node_stats,node_repo,node_user,node_geocoder,node_wrangling toneAmber
class node_dataset,node_tables,node_workbooks,node_githubapi,node_maps toneMint
class node_webcontent,node_webconfig toneRose
class node_operator,node_tableau toneIndigo
```

## Components

### Data collection

- [Stats CLI](https://github.com/donnemartin/viz/blob/master/githubstats/github_stats_cli.py): `githubstats/github_stats_cli.py`
- [GitHub adapter](https://github.com/donnemartin/viz/blob/master/githubstats/lib/github.py): `githubstats/lib/github.py`

### Processing

- [Stats orchestrator](https://github.com/donnemartin/viz/blob/master/githubstats/github_stats.py): `githubstats/github_stats.py`
- [Repository model](https://github.com/donnemartin/viz/blob/master/githubstats/repo.py): `githubstats/repo.py`
- [User model](https://github.com/donnemartin/viz/blob/master/githubstats/user.py): `githubstats/user.py`
- [Location geocoder](https://github.com/donnemartin/viz/blob/master/githubstats/user_geocoder.py): `githubstats/user_geocoder.py`
- [Data wrangling](https://github.com/donnemartin/viz/blob/master/githubstats/data_wrangling.ipynb): `githubstats/data_wrangling.ipynb`

### Published outputs

- [Collected datasets](https://github.com/donnemartin/viz/tree/master/githubstats/data): `githubstats/data`
- [Language tables](https://github.com/donnemartin/viz/tree/master/language_stats): `language_stats`
- [Interactive workbooks](https://github.com/donnemartin/viz/tree/master/viz): `viz`

### Website

- [Website pages](https://github.com/donnemartin/viz/tree/master/site/content/pages): `site/content/pages`
- [Site configuration](https://github.com/donnemartin/viz/blob/master/site/pelicanconf.py): `site/pelicanconf.py`

### Other components

- **Operator**
- **GitHub API**
- **Google Maps API**
- **Tableau Public**

## Connections

- Operator → Stats CLI: runs command (evidence: `githubstats/github_stats_cli.py`)
- Stats CLI → Stats orchestrator: creates and invokes (evidence: `githubstats/github_stats_cli.py`)
- Stats orchestrator → GitHub adapter: queries through (evidence: `githubstats/github_stats.py`)
- GitHub adapter → GitHub API: authenticates and queries (evidence: `githubstats/lib/github.py`)
- Stats orchestrator → Repository model: creates repository records (evidence: `githubstats/github_stats.py`)
- Stats orchestrator → User model: creates account records (evidence: `githubstats/github_stats.py`)
- Stats orchestrator → Location geocoder: updates user locations (evidence: `githubstats/github_stats.py`)
- Location geocoder → Google Maps API: geocodes locations (evidence: `githubstats/user_geocoder.py`)
- Stats orchestrator → Collected datasets: writes CSV data (evidence: `githubstats/github_stats.py`)
- Collected datasets → Data wrangling: supplies data (evidence: `README.md`)
- Collected datasets → Language tables: provides tracked data (evidence: `README.md`)
- Collected datasets → Interactive workbooks: feeds visualizations (evidence: `README.md`)
- Tableau Public → Interactive workbooks: hosts views (evidence: `README.md`)
- Site configuration → Website pages: configures site (evidence: `site/pelicanconf.py`)
