# orangesplash69/wx architecture

> Architecture diagram of the GitHub repository orangesplash69/wx, 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/orangesplash69/wx
- Repository: https://github.com/orangesplash69/wx

## Overview

wx is a single-file terminal weather dashboard. The user supplies a city and options; the app resolves the location, retrieves weather data, and presents a responsive report. Its documented report includes current conditions, metrics, daylight, hourly views, and a multi-day forecast, with additional alert, air-quality, nowcast, and astronomy capabilities indicated by the source excerpt. Most implementation is unsampled, so relationships among those additional features are not inferred.

Main entry points: [`main.py`](https://github.com/orangesplash69/wx/blob/main/main.py) (Report assembly)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Lookup and data"]
  node_cli["CLI options<br/>[main.py]"]
  node_geocoding["City geocoding<br/>[main.py]"]
  node_open_geo{{"Open-Meteo geocoder"}}
  node_latlng_geo{{"latlng geocoder"}}
  node_weather["Weather retrieval<br/>[main.py]"]
  node_open_meteo{{"Open-Meteo weather API"}}
end

subgraph group_report["Weather report"]
  node_report["Report assembly<br/>[main.py]"]
  node_current["Current conditions<br/>[main.py]"]
  node_metrics["Weather metrics<br/>[main.py]"]
  node_daylight["Daylight bar<br/>[main.py]"]
  node_hourly["Hourly views<br/>[main.py]"]
  node_forecast["Multi-day forecast<br/>[main.py]"]
  node_alerts_air_astro["Alerts, air, astro<br/>[main.py]"]
end

subgraph group_runtime["Runtime support"]
  node_cache["Response cache<br/>[main.py]"]
end

node_user(("Terminal user"))
node_terminal(("Terminal display"))

node_user -->|"sets options"| node_cli
node_cli -->|"requests lookup"| node_geocoding
node_geocoding -->|"queries first"| node_open_geo
node_geocoding -->|"falls back"| node_latlng_geo
node_cli -->|"sets forecast"| node_weather
node_weather -->|"fetches weather"| node_open_meteo
node_weather -->|"caches responses"| node_cache
node_weather -->|"supplies data"| node_report
node_report -->|"renders"| node_current
node_report -->|"renders"| node_metrics
node_report -->|"renders"| node_daylight
node_report -->|"renders"| node_hourly
node_report -->|"renders"| node_forecast
node_report -->|"includes capabilities"| node_alerts_air_astro
node_report -->|"displays report"| node_terminal

click node_cli "https://github.com/orangesplash69/wx/blob/main/main.py"
click node_geocoding "https://github.com/orangesplash69/wx/blob/main/main.py"
click node_weather "https://github.com/orangesplash69/wx/blob/main/main.py"
click node_cache "https://github.com/orangesplash69/wx/blob/main/main.py"
click node_report "https://github.com/orangesplash69/wx/blob/main/main.py"
click node_current "https://github.com/orangesplash69/wx/blob/main/main.py"
click node_metrics "https://github.com/orangesplash69/wx/blob/main/main.py"
click node_daylight "https://github.com/orangesplash69/wx/blob/main/main.py"
click node_hourly "https://github.com/orangesplash69/wx/blob/main/main.py"
click node_forecast "https://github.com/orangesplash69/wx/blob/main/main.py"
click node_alerts_air_astro "https://github.com/orangesplash69/wx/blob/main/main.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_geocoding,node_open_geo,node_latlng_geo,node_weather,node_open_meteo,node_user toneBlue
class node_report,node_current,node_metrics,node_daylight,node_hourly,node_forecast,node_alerts_air_astro toneAmber
class node_cache toneMint
class node_terminal toneIndigo
```

## Components

### Lookup and data

- [CLI options](https://github.com/orangesplash69/wx/blob/main/main.py): `main.py`
- [City geocoding](https://github.com/orangesplash69/wx/blob/main/main.py): `main.py`
- **Open-Meteo geocoder**
- **latlng geocoder**
- [Weather retrieval](https://github.com/orangesplash69/wx/blob/main/main.py): `main.py`
- **Open-Meteo weather API**

### Weather report

- [Report assembly](https://github.com/orangesplash69/wx/blob/main/main.py): `main.py`
- [Current conditions](https://github.com/orangesplash69/wx/blob/main/main.py): `main.py`
- [Weather metrics](https://github.com/orangesplash69/wx/blob/main/main.py): `main.py`
- [Daylight bar](https://github.com/orangesplash69/wx/blob/main/main.py): `main.py`
- [Hourly views](https://github.com/orangesplash69/wx/blob/main/main.py): `main.py`
- [Multi-day forecast](https://github.com/orangesplash69/wx/blob/main/main.py): `main.py`
- [Alerts, air, astro](https://github.com/orangesplash69/wx/blob/main/main.py): `main.py`

### Runtime support

- [Response cache](https://github.com/orangesplash69/wx/blob/main/main.py): `main.py`

### Other components

- **Terminal user**
- **Terminal display**

## Connections

- Terminal user → CLI options: sets options (evidence: `README.md`)
- CLI options → City geocoding: requests lookup (evidence: `README.md`)
- City geocoding → Open-Meteo geocoder: queries first (evidence: `README.md`)
- City geocoding → latlng geocoder: falls back (evidence: `README.md`)
- CLI options → Weather retrieval: sets forecast (evidence: `README.md`)
- Weather retrieval → Open-Meteo weather API: fetches weather (evidence: `README.md`)
- Weather retrieval → Response cache: caches responses (evidence: `main.py`)
- Weather retrieval → Report assembly: supplies data (evidence: `README.md`)
- Report assembly → Current conditions: renders (evidence: `README.md`)
- Report assembly → Weather metrics: renders (evidence: `README.md`)
- Report assembly → Daylight bar: renders (evidence: `README.md`)
- Report assembly → Hourly views: renders (evidence: `README.md`)
- Report assembly → Multi-day forecast: renders (evidence: `README.md`)
- Report assembly → Alerts, air, astro: includes capabilities (evidence: `main.py`)
- Report assembly → Terminal display: displays report (evidence: `README.md`)
