# matsdave/ardent_mills architecture

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

- Interactive diagram: https://gitdiagram.com/matsdave/ardent_mills
- Repository: https://github.com/matsdave/ardent_mills

## Overview

This is an Excel-to-Oracle production ETL: a workbook enters through the production runner, is extracted and transformed into OLTP tables, then incremental procedures refresh OLAP dimensions and facts. The repository also documents validation-only runs, file archiving and quarantine, incremental change history, database audit/error tracking, and email alerts. Source excerpts show the OLTP extraction, transformation orchestration, validation, and MERGE loading; production wrapper and OLAP links rely on README documentation, so those edges cite the README.

Main entry points: [`pipelines/pipeline_common.py`](https://github.com/matsdave/ardent_mills/blob/main/pipelines/pipeline_common.py) (Pipeline operations), [`ardent_mills_etl/main.py`](https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/main.py) (OLTP load workflow), [`ardent_mills_etl/loaders/oracle_loader.py`](https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/loaders/oracle_loader.py) (Oracle MERGE loader), [`ardent_mills_etl/transformers/pipeline.py`](https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/transformers/pipeline.py) (Transform orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Pipeline entry and operations"]
  node_runner["Production runner<br/>[run_pipeline.py]"]
  node_operations["Pipeline operations<br/>[pipeline_common.py]"]
end

subgraph group_oltp["OLTP ingestion"]
  node_extract["Excel extraction<br/>[excel_reader.py]"]
  node_settings["Runtime settings<br/>[settings.py]"]
  node_specs["Table specifications<br/>[table_specs.py]"]
  node_etl_main["OLTP load workflow<br/>[main.py]"]
  node_oracle_loader["Oracle MERGE loader<br/>[oracle_loader.py]"]
  node_oltp_store[("Oracle OLTP tables<br/>[01_tables.sql]")]
end

subgraph group_transform["Transformation and quality"]
  node_dimensions["Dimension transforms<br/>[dimensions.py]"]
  node_facts["Fact transforms<br/>[facts.py]"]
  node_transform_pipeline["Transform orchestration<br/>[pipeline.py]"]
  node_helpers["Transform helpers<br/>[helpers.py]"]
  node_validation["Data validation<br/>[validation.py]"]
  node_change_tracker["Incremental history<br/>[change_tracker.py]"]
end

subgraph group_warehouse["OLAP warehouse"]
  node_olap_procedures["Incremental OLAP procedures<br/>[02_procedures.sql]"]
  node_olap_store[("Oracle OLAP tables<br/>[01_tables.sql]")]
end

subgraph group_ops["Run tracking and alerts"]
  node_run_records[("Audit and error records<br/>[01_tables.sql]")]
  node_file_queue["File queue and archive<br/>[pipeline_common.py]"]
end

node_operator(("Pipeline operator"))
node_workbook["Excel workbook"]
node_email["SMTP email service"]

node_operator -->|"starts run"| node_runner
node_workbook -->|"enters queue"| node_file_queue
node_runner -->|"runs pipeline"| node_operations
node_operations -->|"archives and routes"| node_file_queue
node_operations -->|"invokes OLTP load"| node_etl_main
node_etl_main -->|"loads sheets"| node_extract
node_extract -->|"reads sheet settings"| node_settings
node_etl_main -->|"builds tables"| node_transform_pipeline
node_transform_pipeline -->|"builds dimensions"| node_dimensions
node_transform_pipeline -->|"builds facts"| node_facts
node_dimensions -->|"uses utilities"| node_helpers
node_facts -->|"uses utilities"| node_helpers
node_transform_pipeline -->|"orders tables"| node_specs
node_etl_main -->|"checks results"| node_validation
node_etl_main -->|"loads tables"| node_oracle_loader
node_oracle_loader -->|"uses connection config"| node_settings
node_oracle_loader -->|"uses table keys"| node_specs
node_oracle_loader -->|"merges rows"| node_oltp_store
node_operations -->|"tracks incremental changes"| node_change_tracker
node_operations -->|"executes incremental loads"| node_olap_procedures
node_olap_procedures -->|"refreshes dimensions and facts"| node_olap_store
node_operations -->|"writes audit and errors"| node_run_records
node_operations -->|"sends alerts"| node_email

click node_runner "https://github.com/matsdave/ardent_mills/blob/main/run_pipeline.py"
click node_operations "https://github.com/matsdave/ardent_mills/blob/main/pipelines/pipeline_common.py"
click node_extract "https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/utils/excel_reader.py"
click node_settings "https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/config/settings.py"
click node_specs "https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/config/table_specs.py"
click node_etl_main "https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/main.py"
click node_dimensions "https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/transformers/dimensions.py"
click node_facts "https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/transformers/facts.py"
click node_transform_pipeline "https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/transformers/pipeline.py"
click node_helpers "https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/utils/helpers.py"
click node_validation "https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/utils/validation.py"
click node_change_tracker "https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/utils/change_tracker.py"
click node_oracle_loader "https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/loaders/oracle_loader.py"
click node_oltp_store "https://github.com/matsdave/ardent_mills/blob/main/sql/01_tables.sql"
click node_olap_procedures "https://github.com/matsdave/ardent_mills/blob/main/sql/02_procedures.sql"
click node_olap_store "https://github.com/matsdave/ardent_mills/blob/main/sql/01_tables.sql"
click node_run_records "https://github.com/matsdave/ardent_mills/blob/main/sql/01_tables.sql"
click node_file_queue "https://github.com/matsdave/ardent_mills/blob/main/pipelines/pipeline_common.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_operations toneBlue
class node_extract,node_settings,node_specs,node_etl_main,node_oracle_loader,node_oltp_store toneAmber
class node_dimensions,node_facts,node_transform_pipeline,node_helpers,node_validation,node_change_tracker toneMint
class node_olap_procedures,node_olap_store toneRose
class node_run_records,node_file_queue,node_operator,node_workbook,node_email toneIndigo
```

## Components

### Pipeline entry and operations

- [Production runner](https://github.com/matsdave/ardent_mills/blob/main/run_pipeline.py): `run_pipeline.py`
- [Pipeline operations](https://github.com/matsdave/ardent_mills/blob/main/pipelines/pipeline_common.py): `pipelines/pipeline_common.py`

### OLTP ingestion

- [Excel extraction](https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/utils/excel_reader.py): `ardent_mills_etl/utils/excel_reader.py`
- [Runtime settings](https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/config/settings.py): `ardent_mills_etl/config/settings.py`
- [Table specifications](https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/config/table_specs.py): `ardent_mills_etl/config/table_specs.py`
- [OLTP load workflow](https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/main.py): `ardent_mills_etl/main.py`
- [Oracle MERGE loader](https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/loaders/oracle_loader.py): `ardent_mills_etl/loaders/oracle_loader.py`
- [Oracle OLTP tables](https://github.com/matsdave/ardent_mills/blob/main/sql/01_tables.sql): `sql/01_tables.sql`

### Transformation and quality

- [Dimension transforms](https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/transformers/dimensions.py): `ardent_mills_etl/transformers/dimensions.py`
- [Fact transforms](https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/transformers/facts.py): `ardent_mills_etl/transformers/facts.py`
- [Transform orchestration](https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/transformers/pipeline.py): `ardent_mills_etl/transformers/pipeline.py`
- [Transform helpers](https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/utils/helpers.py): `ardent_mills_etl/utils/helpers.py`
- [Data validation](https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/utils/validation.py): `ardent_mills_etl/utils/validation.py`
- [Incremental history](https://github.com/matsdave/ardent_mills/blob/main/ardent_mills_etl/utils/change_tracker.py): `ardent_mills_etl/utils/change_tracker.py`

### OLAP warehouse

- [Incremental OLAP procedures](https://github.com/matsdave/ardent_mills/blob/main/sql/02_procedures.sql): `sql/02_procedures.sql`
- [Oracle OLAP tables](https://github.com/matsdave/ardent_mills/blob/main/sql/01_tables.sql): `sql/01_tables.sql`

### Run tracking and alerts

- [Audit and error records](https://github.com/matsdave/ardent_mills/blob/main/sql/01_tables.sql): `sql/01_tables.sql`
- [File queue and archive](https://github.com/matsdave/ardent_mills/blob/main/pipelines/pipeline_common.py): `pipelines/pipeline_common.py`

### Other components

- **Pipeline operator**
- **Excel workbook**
- **SMTP email service**

## Connections

- Pipeline operator → Production runner: starts run (evidence: `README.md`)
- Excel workbook → File queue and archive: enters queue (evidence: `README.md`)
- Production runner → Pipeline operations: runs pipeline (evidence: `README.md`)
- Pipeline operations → File queue and archive: archives and routes (evidence: `README.md`)
- Pipeline operations → OLTP load workflow: invokes OLTP load (evidence: `README.md`)
- OLTP load workflow → Excel extraction: loads sheets (evidence: `ardent_mills_etl/main.py`)
- Excel extraction → Runtime settings: reads sheet settings (evidence: `ardent_mills_etl/utils/excel_reader.py`)
- OLTP load workflow → Transform orchestration: builds tables (evidence: `ardent_mills_etl/main.py`)
- Transform orchestration → Dimension transforms: builds dimensions (evidence: `ardent_mills_etl/transformers/pipeline.py`)
- Transform orchestration → Fact transforms: builds facts (evidence: `ardent_mills_etl/transformers/pipeline.py`)
- Dimension transforms → Transform helpers: uses utilities (evidence: `ardent_mills_etl/transformers/dimensions.py`)
- Fact transforms → Transform helpers: uses utilities (evidence: `ardent_mills_etl/transformers/facts.py`)
- Transform orchestration → Table specifications: orders tables (evidence: `ardent_mills_etl/transformers/pipeline.py`)
- OLTP load workflow → Data validation: checks results (evidence: `ardent_mills_etl/main.py`)
- OLTP load workflow → Oracle MERGE loader: loads tables (evidence: `ardent_mills_etl/main.py`)
- Oracle MERGE loader → Runtime settings: uses connection config (evidence: `ardent_mills_etl/loaders/oracle_loader.py`)
- Oracle MERGE loader → Table specifications: uses table keys (evidence: `ardent_mills_etl/loaders/oracle_loader.py`)
- Oracle MERGE loader → Oracle OLTP tables: merges rows (evidence: `README.md`)
- Pipeline operations → Incremental history: tracks incremental changes (evidence: `README.md`)
- Pipeline operations → Incremental OLAP procedures: executes incremental loads (evidence: `README.md`)
- Incremental OLAP procedures → Oracle OLAP tables: refreshes dimensions and facts (evidence: `README.md`)
- Pipeline operations → Audit and error records: writes audit and errors (evidence: `README.md`)
- Pipeline operations → SMTP email service: sends alerts (evidence: `README.md`)
