# sikleq/sloppy architecture

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

- Interactive diagram: https://gitdiagram.com/sikleq/sloppy
- Repository: https://github.com/sikleq/sloppy

## Overview

Sloppy is a Python-built static Dota 2 patch reader and reference-materials site. The main workflow turns annotated patch content and game snapshots into tagged, percentage-aware patch pages, which readers can browse and filter; separate builders generate entity histories, calendar/changelog, terrain comparisons, and reference tables. The patch API and shared page writer are the key internal rendering layers. Relationships for unsampled builders are limited to capabilities and wiring stated in the README; the source excerpts do not establish their internal call paths.

Main entry points: [`build_site.py`](https://github.com/sikleq/sloppy/blob/main/build_site.py) (Build entrypoint), [`patch/api.py`](https://github.com/sikleq/sloppy/blob/main/patch/api.py) (Content API), [`patch/elements.py`](https://github.com/sikleq/sloppy/blob/main/patch/elements.py) (Change elements), [`builders/heroes_stats.py`](https://github.com/sikleq/sloppy/blob/main/builders/heroes_stats.py) (Hero stats)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Site generation"]
  node_site["Static site"]
  node_entry["Build entrypoint<br/>[build_site.py]"]
  node_patch_builder["Patch pages<br/>[build_patches.py]"]
  node_shared["Site chrome<br/>[site_common.py]"]
  node_entity["Entity histories<br/>[entity_changes.py]"]
  node_calendar["Calendar and changelog<br/>[changelog.py]"]
  node_silent["Unnoted changes<br/>[silent.py]"]
end

subgraph group_patch["Patch rendering"]
  node_content["Patch definitions<br/>[p741.py]"]
  node_api["Content API<br/>[api.py]"]
  node_elements["Change elements<br/>[elements.py]"]
  node_badges["Tags and deltas<br/>[badges.py]"]
  node_stats[("Game stats<br/>[stats.py]")]
  node_images["Image lookup<br/>[images.py]"]
  node_weights["Change weights<br/>[weights.py]"]
  node_page["Page writer<br/>[page.py]"]
  node_meta["Patch metadata<br/>[meta.py]"]
end

subgraph group_materials["Reference materials"]
  node_heroes["Hero stats<br/>[heroes_stats.py]"]
  node_lab["Hero Lab<br/>[hero_lab.py]"]
  node_mana["Mana items<br/>[mana_items.py]"]
  node_creeps["Neutral creeps<br/>[creeps.py]"]
  node_mat_other["Other materials"]
end

subgraph group_terrain["Terrain comparisons"]
  node_terrain["Map comparisons<br/>[terrain.py]"]
end

subgraph group_recap["Publishing tools"]
  node_recap_tool["Weekly recap<br/>[build_post.py]"]
end

node_reader(("Site reader"))

node_reader -->|"browses"| node_site
node_entry -->|"builds pages"| node_patch_builder
node_entry -->|"builds pages"| node_entity
node_entry -->|"builds pages"| node_calendar
node_entry -->|"builds materials"| node_heroes
node_entry -->|"builds materials"| node_lab
node_entry -->|"builds materials"| node_mana
node_entry -->|"builds materials"| node_creeps
node_entry -->|"builds pages"| node_terrain
node_entry -->|"builds pages"| node_silent
node_entry -->|"builds materials"| node_mat_other
node_patch_builder -->|"discovers patches"| node_content
node_content -->|"uses helpers"| node_api
node_api -->|"re-exports"| node_elements
node_api -->|"re-exports"| node_badges
node_api -->|"re-exports"| node_stats
node_api -->|"re-exports"| node_images
node_api -->|"re-exports"| node_page
node_elements -->|"uses scoring"| node_weights
node_elements -->|"uses tags"| node_badges
node_elements -->|"uses snapshots"| node_stats
node_elements -->|"uses images"| node_images
node_page -->|"uses chrome"| node_shared
node_page -->|"uses metadata"| node_meta
node_patch_builder -->|"writes pages"| node_site
node_entity -->|"uses metadata"| node_meta
node_entity -->|"uses chrome"| node_shared
node_heroes -->|"uses chrome"| node_shared
node_heroes -->|"uses metadata"| node_meta
node_heroes -->|"uses elements"| node_elements
node_lab -->|"uses stats"| node_heroes
node_lab -->|"uses items"| node_mana
node_silent -->|"uses metadata"| node_meta
node_silent -->|"uses chrome"| node_shared
node_creeps -->|"uses entity data"| node_entity
node_creeps -->|"uses metadata"| node_meta
node_creeps -->|"uses chrome"| node_shared
node_recap_tool -->|"uses screenshots"| node_site

click node_entry "https://github.com/sikleq/sloppy/blob/main/build_site.py"
click node_patch_builder "https://github.com/sikleq/sloppy/blob/main/builders/build_patches.py"
click node_content "https://github.com/sikleq/sloppy/blob/main/content/p741.py"
click node_api "https://github.com/sikleq/sloppy/blob/main/patch/api.py"
click node_elements "https://github.com/sikleq/sloppy/blob/main/patch/elements.py"
click node_badges "https://github.com/sikleq/sloppy/blob/main/patch/badges.py"
click node_stats "https://github.com/sikleq/sloppy/blob/main/patch/stats.py"
click node_images "https://github.com/sikleq/sloppy/blob/main/patch/images.py"
click node_weights "https://github.com/sikleq/sloppy/blob/main/patch/weights.py"
click node_page "https://github.com/sikleq/sloppy/blob/main/patch/page.py"
click node_meta "https://github.com/sikleq/sloppy/blob/main/patch/meta.py"
click node_shared "https://github.com/sikleq/sloppy/blob/main/builders/site_common.py"
click node_entity "https://github.com/sikleq/sloppy/blob/main/builders/entity_changes.py"
click node_calendar "https://github.com/sikleq/sloppy/blob/main/builders/changelog.py"
click node_silent "https://github.com/sikleq/sloppy/blob/main/builders/silent.py"
click node_heroes "https://github.com/sikleq/sloppy/blob/main/builders/heroes_stats.py"
click node_lab "https://github.com/sikleq/sloppy/blob/main/builders/hero_lab.py"
click node_mana "https://github.com/sikleq/sloppy/blob/main/builders/mana_items.py"
click node_creeps "https://github.com/sikleq/sloppy/blob/main/builders/creeps.py"
click node_mat_other "https://github.com/sikleq/sloppy/tree/main/builders"
click node_terrain "https://github.com/sikleq/sloppy/blob/main/builders/terrain.py"
click node_recap_tool "https://github.com/sikleq/sloppy/blob/main/tools/telegraph_post/build_post.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_site,node_entry,node_patch_builder,node_shared,node_entity,node_calendar,node_silent toneBlue
class node_content,node_api,node_elements,node_badges,node_stats,node_images,node_weights,node_page,node_meta toneAmber
class node_heroes,node_lab,node_mana,node_creeps,node_mat_other toneMint
class node_terrain toneRose
class node_recap_tool,node_reader toneIndigo
```

## Components

### Site generation

- **Static site**
- [Build entrypoint](https://github.com/sikleq/sloppy/blob/main/build_site.py): `build_site.py`
- [Patch pages](https://github.com/sikleq/sloppy/blob/main/builders/build_patches.py): `builders/build_patches.py`
- [Site chrome](https://github.com/sikleq/sloppy/blob/main/builders/site_common.py): `builders/site_common.py`
- [Entity histories](https://github.com/sikleq/sloppy/blob/main/builders/entity_changes.py): `builders/entity_changes.py`
- [Calendar and changelog](https://github.com/sikleq/sloppy/blob/main/builders/changelog.py): `builders/changelog.py`
- [Unnoted changes](https://github.com/sikleq/sloppy/blob/main/builders/silent.py): `builders/silent.py`

### Patch rendering

- [Patch definitions](https://github.com/sikleq/sloppy/blob/main/content/p741.py): `content/p741.py`
- [Content API](https://github.com/sikleq/sloppy/blob/main/patch/api.py): `patch/api.py`
- [Change elements](https://github.com/sikleq/sloppy/blob/main/patch/elements.py): `patch/elements.py`
- [Tags and deltas](https://github.com/sikleq/sloppy/blob/main/patch/badges.py): `patch/badges.py`
- [Game stats](https://github.com/sikleq/sloppy/blob/main/patch/stats.py): `patch/stats.py`
- [Image lookup](https://github.com/sikleq/sloppy/blob/main/patch/images.py): `patch/images.py`
- [Change weights](https://github.com/sikleq/sloppy/blob/main/patch/weights.py): `patch/weights.py`
- [Page writer](https://github.com/sikleq/sloppy/blob/main/patch/page.py): `patch/page.py`
- [Patch metadata](https://github.com/sikleq/sloppy/blob/main/patch/meta.py): `patch/meta.py`

### Reference materials

- [Hero stats](https://github.com/sikleq/sloppy/blob/main/builders/heroes_stats.py): `builders/heroes_stats.py`
- [Hero Lab](https://github.com/sikleq/sloppy/blob/main/builders/hero_lab.py): `builders/hero_lab.py`
- [Mana items](https://github.com/sikleq/sloppy/blob/main/builders/mana_items.py): `builders/mana_items.py`
- [Neutral creeps](https://github.com/sikleq/sloppy/blob/main/builders/creeps.py): `builders/creeps.py`
- [Other materials](https://github.com/sikleq/sloppy/tree/main/builders): `builders`

### Terrain comparisons

- [Map comparisons](https://github.com/sikleq/sloppy/blob/main/builders/terrain.py): `builders/terrain.py`

### Publishing tools

- [Weekly recap](https://github.com/sikleq/sloppy/blob/main/tools/telegraph_post/build_post.py): `tools/telegraph_post/build_post.py`

### Other components

- **Site reader**

## Connections

- Site reader → Static site: browses (evidence: `README.md`)
- Build entrypoint → Patch pages: builds pages (evidence: `README.md`)
- Build entrypoint → Entity histories: builds pages (evidence: `README.md`)
- Build entrypoint → Calendar and changelog: builds pages (evidence: `README.md`)
- Build entrypoint → Hero stats: builds materials (evidence: `README.md`)
- Build entrypoint → Hero Lab: builds materials (evidence: `README.md`)
- Build entrypoint → Mana items: builds materials (evidence: `README.md`)
- Build entrypoint → Neutral creeps: builds materials (evidence: `README.md`)
- Build entrypoint → Map comparisons: builds pages (evidence: `README.md`)
- Build entrypoint → Unnoted changes: builds pages (evidence: `README.md`)
- Build entrypoint → Other materials: builds materials (evidence: `README.md`)
- Patch pages → Patch definitions: discovers patches (evidence: `README.md`)
- Patch definitions → Content API: uses helpers (evidence: `content/p741.py`)
- Content API → Change elements: re-exports (evidence: `patch/api.py`)
- Content API → Tags and deltas: re-exports (evidence: `patch/api.py`)
- Content API → Game stats: re-exports (evidence: `patch/api.py`)
- Content API → Image lookup: re-exports (evidence: `patch/api.py`)
- Content API → Page writer: re-exports (evidence: `patch/api.py`)
- Change elements → Change weights: uses scoring (evidence: `patch/elements.py`)
- Change elements → Tags and deltas: uses tags (evidence: `patch/elements.py`)
- Change elements → Game stats: uses snapshots (evidence: `patch/elements.py`)
- Change elements → Image lookup: uses images (evidence: `patch/elements.py`)
- Page writer → Site chrome: uses chrome (evidence: `patch/page.py`)
- Page writer → Patch metadata: uses metadata (evidence: `patch/page.py`)
- Patch pages → Static site: writes pages (evidence: `README.md`)
- Entity histories → Patch metadata: uses metadata (evidence: `builders/entity_changes.py`)
- Entity histories → Site chrome: uses chrome (evidence: `builders/entity_changes.py`)
- Hero stats → Site chrome: uses chrome (evidence: `builders/heroes_stats.py`)
- Hero stats → Patch metadata: uses metadata (evidence: `builders/heroes_stats.py`)
- Hero stats → Change elements: uses elements (evidence: `builders/heroes_stats.py`)
- Hero Lab → Hero stats: uses stats (evidence: `builders/hero_lab.py`)
- Hero Lab → Mana items: uses items (evidence: `builders/hero_lab.py`)
- Unnoted changes → Patch metadata: uses metadata (evidence: `builders/silent.py`)
- Unnoted changes → Site chrome: uses chrome (evidence: `builders/silent.py`)
- Neutral creeps → Entity histories: uses entity data (evidence: `builders/creeps.py`)
- Neutral creeps → Patch metadata: uses metadata (evidence: `builders/creeps.py`)
- Neutral creeps → Site chrome: uses chrome (evidence: `builders/creeps.py`)
- Weekly recap → Static site: uses screenshots (evidence: `tools/telegraph_post/build_post.py`)
