# mohamedaminejemni28/open_meteo_project_pipeline architecture

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

- Interactive diagram: https://gitdiagram.com/mohamedaminejemni28/open_meteo_project_pipeline
- Repository: https://github.com/mohamedaminejemni28/open_meteo_project_pipeline

## Overview

This repository implements a scheduled weather-data pipeline: Airflow runs ingestion, which fetches current observations from Open-Meteo and writes them to Snowflake, then launches dbt transformations. A separate seed script can populate recent hourly history. The dbt project is represented by its staging, intermediate, and mart SQL models from the file tree; their SQL contents were not sampled, so model-to-model and warehouse relationships are shown only as unverified dashed links.

Main entry points: [`snowflake_data_project/models/staging/stg_weather_data.sql`](https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/snowflake_data_project/models/staging/stg_weather_data.sql) (Weather staging), [`dbt_core_dag.py`](https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/dbt_core_dag.py) (Ingest task), [`script/insert_records.py`](https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/script/insert_records.py) (Current weather loader), [`script/api_request.py`](https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/script/api_request.py) (API request client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Orchestration"]
  node_airflow["Airflow schedule<br/>[dbt_core_dag.py]"]
  node_ingest_task["Ingest task<br/>[dbt_core_dag.py]"]
  node_dbt_task["dbt build task<br/>[dbt_core_dag.py]"]
end

subgraph group_ingestion["Weather ingestion"]
  node_record_loader["Current weather loader<br/>[insert_records.py]"]
  node_api_client["API request client<br/>[api_request.py]"]
  node_history_seed["History seeder<br/>[seed_weather.py]"]
end

subgraph group_warehouse["Warehouse transforms"]
  node_dbt_project["dbt project<br/>[dbt_project.yml]"]
  node_staging["Weather staging"]
  node_intermediate["Daily intermediate"]
  node_daily_average["Daily average mart<br/>[daily_average.sql]"]
  node_weather_report["Weather report mart<br/>[weather_report.sql]"]
end

node_open_meteo(("Open-Meteo"))
node_snowflake[("Snowflake")]

node_airflow -->|"defines task"| node_ingest_task
node_airflow -->|"defines task"| node_dbt_task
node_ingest_task -->|"calls main"| node_record_loader
node_ingest_task -->|"precedes"| node_dbt_task
node_dbt_task -->|"runs build"| node_dbt_project
node_record_loader -->|"fetches via"| node_api_client
node_api_client -->|"requests data"| node_open_meteo
node_record_loader -->|"creates and inserts"| node_snowflake
node_history_seed -->|"fetches via"| node_api_client
node_history_seed -->|"seeds observations"| node_snowflake
node_dbt_project -.->|"includes model"| node_staging
node_staging -.->|"feeds"| node_intermediate
node_intermediate -.->|"feeds"| node_daily_average
node_staging -.->|"feeds"| node_weather_report
node_snowflake -.->|"model source"| node_staging
node_daily_average -.->|"materializes in"| node_snowflake
node_weather_report -.->|"materializes in"| node_snowflake

click node_airflow "https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/dbt_core_dag.py"
click node_ingest_task "https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/dbt_core_dag.py"
click node_dbt_task "https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/dbt_core_dag.py"
click node_record_loader "https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/script/insert_records.py"
click node_api_client "https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/script/api_request.py"
click node_history_seed "https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/script/seed_weather.py"
click node_dbt_project "https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/snowflake_data_project/dbt_project.yml"
click node_staging "https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/snowflake_data_project/models/staging/stg_weather_data.sql"
click node_intermediate "https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/snowflake_data_project/models/Intermediate/int_weather_day.sql"
click node_daily_average "https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/snowflake_data_project/models/marts/daily_average.sql"
click node_weather_report "https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/snowflake_data_project/models/marts/weather_report.sql"

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_airflow,node_ingest_task,node_dbt_task toneBlue
class node_record_loader,node_api_client,node_history_seed,node_snowflake toneAmber
class node_dbt_project,node_staging,node_intermediate,node_daily_average,node_weather_report toneMint
class node_open_meteo toneIndigo
```

## Components

### Orchestration

- [Airflow schedule](https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/dbt_core_dag.py): `dbt_core_dag.py`
- [Ingest task](https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/dbt_core_dag.py): `dbt_core_dag.py`
- [dbt build task](https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/dbt_core_dag.py): `dbt_core_dag.py`

### Weather ingestion

- [Current weather loader](https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/script/insert_records.py): `script/insert_records.py`
- [API request client](https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/script/api_request.py): `script/api_request.py`
- [History seeder](https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/script/seed_weather.py): `script/seed_weather.py`

### Warehouse transforms

- [dbt project](https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/snowflake_data_project/dbt_project.yml): `snowflake_data_project/dbt_project.yml`
- [Weather staging](https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/snowflake_data_project/models/staging/stg_weather_data.sql): `snowflake_data_project/models/staging/stg_weather_data.sql`
- [Daily intermediate](https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/snowflake_data_project/models/Intermediate/int_weather_day.sql): `snowflake_data_project/models/Intermediate/int_weather_day.sql`
- [Daily average mart](https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/snowflake_data_project/models/marts/daily_average.sql): `snowflake_data_project/models/marts/daily_average.sql`
- [Weather report mart](https://github.com/mohamedaminejemni28/open_meteo_project_pipeline/blob/main/snowflake_data_project/models/marts/weather_report.sql): `snowflake_data_project/models/marts/weather_report.sql`

### Other components

- **Open-Meteo**
- **Snowflake**

## Connections

- Airflow schedule → Ingest task: defines task (evidence: `dbt_core_dag.py`)
- Airflow schedule → dbt build task: defines task (evidence: `dbt_core_dag.py`)
- Ingest task → Current weather loader: calls main (evidence: `dbt_core_dag.py`)
- Ingest task → dbt build task: precedes (evidence: `dbt_core_dag.py`)
- dbt build task → dbt project: runs build (evidence: `dbt_core_dag.py`)
- Current weather loader → API request client: fetches via (evidence: `script/insert_records.py`)
- API request client → Open-Meteo: requests data (evidence: `script/api_request.py`)
- Current weather loader → Snowflake: creates and inserts (evidence: `script/insert_records.py`)
- History seeder → API request client: fetches via (evidence: `script/seed_weather.py`)
- History seeder → Snowflake: seeds observations (evidence: `script/seed_weather.py`)
- dbt project → Weather staging: includes model
- Weather staging → Daily intermediate: feeds
- Daily intermediate → Daily average mart: feeds
- Weather staging → Weather report mart: feeds
- Snowflake → Weather staging: model source
- Daily average mart → Snowflake: materializes in
- Weather report mart → Snowflake: materializes in
