# neurodendrite/calcio-forecast architecture

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

- Interactive diagram: https://gitdiagram.com/neurodendrite/calcio-forecast
- Repository: https://github.com/neurodendrite/calcio-forecast

## Overview

Calcio Forecast is a local football-probability and forecasting application. Its documented historical-data workflow runs from the CLI through source acquisition, team-name resolution and quality checks into persistent records; forecasts are registered before match results and later compared to assess reliability. The README also describes Elo and Poisson/Dixon–Coles predictions and season simulations. The graph includes the documented UI and forecast branches, but several of their internal call paths are not shown in the supplied excerpts, so those links are left unasserted.

Main entry points: [`src/calcio_forecast/acquisizione/pipeline.py`](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/acquisizione/pipeline.py) (Import pipeline), [`src/calcio_forecast/servizi/spot.py`](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/servizi/spot.py) (Spot workflow), [`src/calcio_forecast/cli.py`](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/cli.py) (CLI commands), [`src/calcio_forecast/servizi/importazione.py`](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/servizi/importazione.py) (Import service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_cli["CLI commands<br/>[cli.py]"]
  node_ui["Desktop UI<br/>[app.py]"]
  node_window["Main window<br/>[finestra.py]"]
end

subgraph group_acquisition["Data acquisition"]
  node_sources["Football data sources"]
  node_http["HTTP client<br/>[http.py]"]
  node_import_service["Import service<br/>[importazione.py]"]
  node_pipeline["Import pipeline<br/>[pipeline.py]"]
  node_team_registry["Team resolution<br/>[seed.py]"]
  node_match_records["Match records<br/>[partite.py]"]
  node_quality["Data quality<br/>[qualita.py]"]
end

subgraph group_forecast["Forecasting"]
  node_spot["Spot workflow<br/>[spot.py]"]
  node_elo["Elo ratings<br/>[elo.py]"]
  node_ordered_outcome["Outcome probabilities<br/>[esito_ordinato.py]"]
  node_season_sims["Season simulations"]
  node_prediction_register["Prediction register<br/>[registro.py]"]
  node_comparison["Forecast comparison<br/>[confronto.py]"]
end

subgraph group_storage["Persistence and configuration"]
  node_archive[("Data archive<br/>[archivio.py]")]
  node_database[("SQLite database<br/>[db.py]")]
  node_settings["Settings and paths<br/>[impostazioni.py]"]
end

node_user(("User"))

node_user -->|"runs commands"| node_cli
node_cli -->|"runs import"| node_import_service
node_import_service -->|"starts import"| node_pipeline
node_pipeline -->|"requests data"| node_http
node_pipeline -->|"selects sources"| node_sources
node_pipeline -->|"resolves teams"| node_team_registry
node_pipeline -->|"checks records"| node_quality
node_pipeline -->|"normalizes matches"| node_match_records
node_pipeline -->|"stores import data"| node_archive
node_archive -->|"writes records"| node_database
node_cli -->|"launches UI"| node_ui
node_ui -->|"opens window"| node_window
node_user -->|"uses application"| node_ui
node_user -.->|"requests forecasts"| node_spot
node_spot -->|"calculates ratings"| node_elo
node_spot -->|"computes outcomes"| node_ordered_outcome
node_spot -->|"registers forecasts"| node_prediction_register
node_spot -->|"reads match data"| node_archive
node_user -.->|"reviews accuracy"| node_comparison
node_comparison -->|"compares forecasts"| node_prediction_register
node_user -.->|"requests simulations"| node_season_sims
node_cli -->|"loads settings"| node_settings
node_import_service -->|"uses settings"| node_settings

click node_cli "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/cli.py"
click node_ui "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/ui/app.py"
click node_window "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/ui/finestra.py"
click node_sources "https://github.com/neurodendrite/calcio-forecast/tree/main/src/calcio_forecast/acquisizione/fonti"
click node_http "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/acquisizione/http.py"
click node_import_service "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/servizi/importazione.py"
click node_pipeline "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/acquisizione/pipeline.py"
click node_team_registry "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/anagrafica/seed.py"
click node_match_records "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/dominio/partite.py"
click node_quality "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/acquisizione/qualita.py"
click node_spot "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/servizi/spot.py"
click node_elo "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/modelli/elo.py"
click node_ordered_outcome "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/modelli/esito_ordinato.py"
click node_season_sims "https://github.com/neurodendrite/calcio-forecast/tree/main/src/calcio_forecast/modelli"
click node_prediction_register "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/dominio/registro.py"
click node_comparison "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/servizi/confronto.py"
click node_archive "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/dati/archivio.py"
click node_database "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/dati/db.py"
click node_settings "https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/configurazione/impostazioni.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_ui,node_window,node_user toneBlue
class node_sources,node_http,node_import_service,node_pipeline,node_team_registry,node_match_records,node_quality toneAmber
class node_spot,node_elo,node_ordered_outcome,node_season_sims,node_prediction_register,node_comparison toneMint
class node_archive,node_database,node_settings toneRose
```

## Components

### Application entry

- [CLI commands](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/cli.py): `src/calcio_forecast/cli.py`
- [Desktop UI](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/ui/app.py): `src/calcio_forecast/ui/app.py`
- [Main window](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/ui/finestra.py): `src/calcio_forecast/ui/finestra.py`

### Data acquisition

- [Football data sources](https://github.com/neurodendrite/calcio-forecast/tree/main/src/calcio_forecast/acquisizione/fonti): `src/calcio_forecast/acquisizione/fonti`
- [HTTP client](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/acquisizione/http.py): `src/calcio_forecast/acquisizione/http.py`
- [Import service](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/servizi/importazione.py): `src/calcio_forecast/servizi/importazione.py`
- [Import pipeline](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/acquisizione/pipeline.py): `src/calcio_forecast/acquisizione/pipeline.py`
- [Team resolution](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/anagrafica/seed.py): `src/calcio_forecast/anagrafica/seed.py`
- [Match records](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/dominio/partite.py): `src/calcio_forecast/dominio/partite.py`
- [Data quality](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/acquisizione/qualita.py): `src/calcio_forecast/acquisizione/qualita.py`

### Forecasting

- [Spot workflow](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/servizi/spot.py): `src/calcio_forecast/servizi/spot.py`
- [Elo ratings](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/modelli/elo.py): `src/calcio_forecast/modelli/elo.py`
- [Outcome probabilities](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/modelli/esito_ordinato.py): `src/calcio_forecast/modelli/esito_ordinato.py`
- [Season simulations](https://github.com/neurodendrite/calcio-forecast/tree/main/src/calcio_forecast/modelli): `src/calcio_forecast/modelli`
- [Prediction register](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/dominio/registro.py): `src/calcio_forecast/dominio/registro.py`
- [Forecast comparison](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/servizi/confronto.py): `src/calcio_forecast/servizi/confronto.py`

### Persistence and configuration

- [Data archive](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/dati/archivio.py): `src/calcio_forecast/dati/archivio.py`
- [SQLite database](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/dati/db.py): `src/calcio_forecast/dati/db.py`
- [Settings and paths](https://github.com/neurodendrite/calcio-forecast/blob/main/src/calcio_forecast/configurazione/impostazioni.py): `src/calcio_forecast/configurazione/impostazioni.py`

### Other components

- **User**

## Connections

- User → CLI commands: runs commands (evidence: `README.md`)
- CLI commands → Import service: runs import (evidence: `src/calcio_forecast/cli.py`)
- Import service → Import pipeline: starts import (evidence: `src/calcio_forecast/servizi/importazione.py`)
- Import pipeline → HTTP client: requests data (evidence: `src/calcio_forecast/acquisizione/pipeline.py`)
- Import pipeline → Football data sources: selects sources (evidence: `src/calcio_forecast/acquisizione/pipeline.py`)
- Import pipeline → Team resolution: resolves teams (evidence: `src/calcio_forecast/acquisizione/pipeline.py`)
- Import pipeline → Data quality: checks records (evidence: `src/calcio_forecast/acquisizione/pipeline.py`)
- Import pipeline → Match records: normalizes matches (evidence: `src/calcio_forecast/acquisizione/pipeline.py`)
- Import pipeline → Data archive: stores import data (evidence: `src/calcio_forecast/acquisizione/pipeline.py`)
- Data archive → SQLite database: writes records (evidence: `src/calcio_forecast/dati/archivio.py`)
- CLI commands → Desktop UI: launches UI (evidence: `src/calcio_forecast/cli.py`)
- Desktop UI → Main window: opens window (evidence: `src/calcio_forecast/ui/app.py`)
- User → Desktop UI: uses application (evidence: `README.md`)
- User → Spot workflow: requests forecasts
- Spot workflow → Elo ratings: calculates ratings (evidence: `src/calcio_forecast/servizi/spot.py`)
- Spot workflow → Outcome probabilities: computes outcomes (evidence: `src/calcio_forecast/servizi/spot.py`)
- Spot workflow → Prediction register: registers forecasts (evidence: `src/calcio_forecast/servizi/spot.py`)
- Spot workflow → Data archive: reads match data (evidence: `src/calcio_forecast/servizi/spot.py`)
- User → Forecast comparison: reviews accuracy
- Forecast comparison → Prediction register: compares forecasts (evidence: `README.md`)
- User → Season simulations: requests simulations
- CLI commands → Settings and paths: loads settings (evidence: `src/calcio_forecast/cli.py`)
- Import service → Settings and paths: uses settings (evidence: `src/calcio_forecast/servizi/importazione.py`)
