# bingmen/bing-uhd architecture

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

- Interactive diagram: https://gitdiagram.com/bingmen/bing-uhd
- Repository: https://github.com/bingmen/bing-uhd

## Overview

This repository is an automated Chinese-region Bing wallpaper collector and yearly archive. Its main workflow fetches Bing’s image metadata, saves each image’s UHD and 320×240 versions plus per-image JSON, then merges yearly metadata and generates a Markdown archive. The README also describes the thumbnail archive and yearly summary tables. The sampled script shows the main processing and file writes; the scheduled trigger is not evidenced by the excerpts, so it is not connected here.

Main entry points: [`bing-UHD-cn.py`](https://github.com/bingmen/bing-uhd/blob/main/bing-UHD-cn.py) (Collector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Collection"]
  node_runner["Collector<br/>[bing-UHD-cn.py]"]
  node_metadata["Image Metadata<br/>[bing-UHD-cn.py]"]
  node_dailyjson["Daily JSON"]
end

subgraph group_assets["Image Assets"]
  node_uhd["UHD Images"]
  node_thumbs["Thumbnails"]
end

subgraph group_archive["Yearly Archive"]
  node_yearmerge["Yearly Merge<br/>[bing-UHD-cn.py]"]
  node_yearjson["Yearly JSON"]
  node_markdown["Markdown Archive"]
end

node_bing(("Bing Image API"))
node_reader(("Archive Reader"))

node_runner -->|"fetches metadata"| node_bing
node_runner -->|"processes images"| node_metadata
node_runner -->|"saves records"| node_dailyjson
node_runner -->|"downloads UHD"| node_uhd
node_runner -->|"downloads thumbnails"| node_thumbs
node_runner -->|"merges yearly data"| node_yearmerge
node_yearmerge -->|"writes summary"| node_yearjson
node_runner -->|"generates archive"| node_markdown
node_reader -.->|"views archive"| node_markdown

click node_runner "https://github.com/bingmen/bing-uhd/blob/main/bing-UHD-cn.py"
click node_metadata "https://github.com/bingmen/bing-uhd/blob/main/bing-UHD-cn.py"
click node_yearmerge "https://github.com/bingmen/bing-uhd/blob/main/bing-UHD-cn.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_runner,node_metadata,node_dailyjson toneBlue
class node_uhd,node_thumbs toneAmber
class node_yearmerge,node_yearjson,node_markdown,node_bing toneMint
class node_reader toneIndigo
```

## Components

### Collection

- [Collector](https://github.com/bingmen/bing-uhd/blob/main/bing-UHD-cn.py): `bing-UHD-cn.py`
- [Image Metadata](https://github.com/bingmen/bing-uhd/blob/main/bing-UHD-cn.py): `bing-UHD-cn.py`
- **Daily JSON**

### Image Assets

- **UHD Images**
- **Thumbnails**

### Yearly Archive

- [Yearly Merge](https://github.com/bingmen/bing-uhd/blob/main/bing-UHD-cn.py): `bing-UHD-cn.py`
- **Yearly JSON**
- **Markdown Archive**

### Other components

- **Bing Image API**
- **Archive Reader**

## Connections

- Collector → Bing Image API: fetches metadata (evidence: `bing-UHD-cn.py`)
- Collector → Image Metadata: processes images (evidence: `bing-UHD-cn.py`)
- Collector → Daily JSON: saves records (evidence: `bing-UHD-cn.py`)
- Collector → UHD Images: downloads UHD (evidence: `bing-UHD-cn.py`)
- Collector → Thumbnails: downloads thumbnails (evidence: `bing-UHD-cn.py`)
- Collector → Yearly Merge: merges yearly data (evidence: `bing-UHD-cn.py`)
- Yearly Merge → Yearly JSON: writes summary (evidence: `bing-UHD-cn.py`)
- Collector → Markdown Archive: generates archive (evidence: `bing-UHD-cn.py`)
- Archive Reader → Markdown Archive: views archive (evidence: `README.md`)
