# msloan01225-source/horse-vaule- architecture

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

- Interactive diagram: https://gitdiagram.com/msloan01225-source/horse-vaule-
- Repository: https://github.com/msloan01225-source/horse-vaule-

## Overview

BetEdge is presented as a multi-country horse-racing value finder, but this checkout is an incomplete implementation: the README describes a Streamlit app and several analysis features whose app entry point and supporting modules are absent from the tree. The visible code covers odds merging, placeholder odds and USA data, score calculations, and model training. The README documents broader UI capabilities, but their runtime wiring cannot be verified from the sampled source.

Main entry points: [`train_edgebrain.py`](https://github.com/msloan01225-source/horse-vaule-/blob/main/train_edgebrain.py) (Model training), [`merge_odds.py`](https://github.com/msloan01225-source/horse-vaule-/blob/main/merge_odds.py) (Best-price merger), [`historical.csv`](https://github.com/msloan01225-source/horse-vaule-/blob/main/historical.csv) (Historical results), [`README.md`](https://github.com/msloan01225-source/horse-vaule-/blob/main/README.md) (Documented app features)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_market["Market data"]
  node_merge["Best-price merger<br/>[merge_odds.py]"]
  node_usa["USA scraper<br/>[usa_scraper.py]"]
  node_odds["Live odds stub<br/>[odds_fetcher.py]"]
  node_race_sources["Race source scrapers"]
end

subgraph group_analysis["Value analysis"]
  node_score["Value scoring<br/>[betedge_score.py]"]
end

subgraph group_model["EdgeBrain model"]
  node_training["Model training<br/>[train_edgebrain.py]"]
  node_history[("Historical results<br/>[historical.csv]")]
  node_model_artifact["Trained model file"]
end

subgraph group_product["Product interface"]
  node_app_features["Documented app features<br/>[README.md]"]
end

node_user(("Racing analyst"))

node_merge -->|"requests data"| node_race_sources
node_training -->|"reads results"| node_history
node_training -->|"writes model"| node_model_artifact
node_user -.->|"uses app"| node_app_features

click node_merge "https://github.com/msloan01225-source/horse-vaule-/blob/main/merge_odds.py"
click node_usa "https://github.com/msloan01225-source/horse-vaule-/blob/main/usa_scraper.py"
click node_odds "https://github.com/msloan01225-source/horse-vaule-/blob/main/odds_fetcher.py"
click node_score "https://github.com/msloan01225-source/horse-vaule-/blob/main/betedge_score.py"
click node_training "https://github.com/msloan01225-source/horse-vaule-/blob/main/train_edgebrain.py"
click node_history "https://github.com/msloan01225-source/horse-vaule-/blob/main/historical.csv"
click node_app_features "https://github.com/msloan01225-source/horse-vaule-/blob/main/README.md"

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_merge,node_usa,node_odds,node_race_sources toneBlue
class node_score toneAmber
class node_training,node_history,node_model_artifact toneMint
class node_app_features toneRose
class node_user toneIndigo
```

## Components

### Market data

- [Best-price merger](https://github.com/msloan01225-source/horse-vaule-/blob/main/merge_odds.py): `merge_odds.py`
- [USA scraper](https://github.com/msloan01225-source/horse-vaule-/blob/main/usa_scraper.py): `usa_scraper.py`
- [Live odds stub](https://github.com/msloan01225-source/horse-vaule-/blob/main/odds_fetcher.py): `odds_fetcher.py`
- **Race source scrapers**

### Value analysis

- [Value scoring](https://github.com/msloan01225-source/horse-vaule-/blob/main/betedge_score.py): `betedge_score.py`

### EdgeBrain model

- [Model training](https://github.com/msloan01225-source/horse-vaule-/blob/main/train_edgebrain.py): `train_edgebrain.py`
- [Historical results](https://github.com/msloan01225-source/horse-vaule-/blob/main/historical.csv): `historical.csv`
- **Trained model file**

### Product interface

- [Documented app features](https://github.com/msloan01225-source/horse-vaule-/blob/main/README.md): `README.md`

### Other components

- **Racing analyst**

## Connections

- Best-price merger → Race source scrapers: requests data (evidence: `merge_odds.py`)
- Model training → Historical results: reads results (evidence: `train_edgebrain.py`)
- Model training → Trained model file: writes model (evidence: `train_edgebrain.py`)
- Racing analyst → Documented app features: uses app (evidence: `README.md`)
