# antonia-cordova/neurological-data-lake architecture

> Architecture diagram of the GitHub repository antonia-cordova/neurological-data-lake, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/antonia-cordova/neurological-data-lake
- Repository: https://github.com/antonia-cordova/neurological-data-lake

## Overview

Neurological Data Lake integra fuentes de salud, demografía y geografía en capas Landing, Bronze, Silver y Gold, con escenarios de calidad independientes. El flujo principal es coordinado por el punto de entrada, transforma y valida datos hasta productos analíticos Gold; además, Quality Generator degrada Medium y Poor tomando Perfect como referencia. Las flechas de capas reflejan capacidades documentadas; las conexiones de módulos se limitan a relaciones indicadas por los extractos o el índice de fuentes.

Main entry points: [`scripts/run_pipeline.py`](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/run_pipeline.py) (Pipeline principal), [`scripts/silver`](https://github.com/antonia-cordova/neurological-data-lake/tree/develop/scripts/silver) (ETL Silver por fuente), [`scripts/bronze/bronze_simulator.py`](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/bronze/bronze_simulator.py) (Simulador Bronze), [`scripts/run_gold_pipeline.py`](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/run_gold_pipeline.py) (Orquestador Gold)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_coord["Coordinación y configuración"]
  node_runner["Pipeline principal<br/>[run_pipeline.py]"]
  node_dbconfig["Escenarios de BD<br/>[database_config.py]"]
  node_dbconn["Conexión PostgreSQL"]
  node_initializer["Esquemas y control"]
end

subgraph group_ingest["Recepción e ingesta"]
  node_landing["Preparación Landing<br/>[prepare_landing.py]"]
  node_bronze["Simulador Bronze"]
  node_parquet["Lectura Parquet<br/>[parquet_io.py]"]
end

subgraph group_silver["Silver normalizado"]
  node_silverrunner["Orquestador Silver"]
  node_silveretl["ETL Silver por fuente"]
  node_geography["Integración geográfica<br/>[etl_geography.py]"]
  node_budget["Presupuesto Silver<br/>[silver_budget.py]"]
end

subgraph group_gold["Gold analítico"]
  node_goldrunner["Orquestador Gold"]
  node_goldetl["ETL dimensional"]
  node_runvalidator["Validador de ejecuciones"]
end

subgraph group_quality["Calidad y trazabilidad"]
  node_qualitygen["Degradación controlada"]
  node_groundtruth["Ground Truth<br/>[ground_truth.py]"]
  node_qualityvalidate["Validación Ground Truth"]
end

node_operator(("Operador"))
node_sources["Archivos fuente"]
node_database[("PostgreSQL")]

node_operator -->|"inicia"| node_runner
node_sources -->|"recibe archivos"| node_landing
node_runner -->|"ejecuta"| node_bronze
node_runner -->|"inicializa"| node_initializer
node_runner -->|"coordina etapas"| node_silverrunner
node_runner -->|"coordina etapas"| node_goldrunner
node_landing -->|"organiza originales"| node_bronze
node_bronze -->|"produce Parquet"| node_parquet
node_bronze -->|"registra ingesta"| node_database
node_initializer -->|"crea esquemas"| node_database
node_silverrunner -->|"ejecuta ETL"| node_silveretl
node_silveretl -->|"lee conjuntos"| node_parquet
node_silveretl -->|"escribe datos"| node_database
node_silveretl -->|"aplica límites"| node_budget
node_geography -->|"integra geografías"| node_database
node_goldrunner -->|"ejecuta ETL"| node_goldetl
node_goldetl -->|"lee Silver y carga Gold"| node_database
node_goldetl -->|"valida ejecución"| node_runvalidator
node_goldrunner -->|"valida y coordina"| node_database
node_qualitygen -->|"degrada escenarios"| node_database
node_qualitygen -->|"recupera referencia"| node_groundtruth
node_qualityvalidate -->|"valida cambios"| node_database
node_qualityvalidate -->|"comprueba referencia"| node_groundtruth

click node_runner "https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/run_pipeline.py"
click node_dbconfig "https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/database_config.py"
click node_dbconn "https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/database_connection.py"
click node_landing "https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/landing/prepare_landing.py"
click node_bronze "https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/bronze/bronze_simulator.py"
click node_parquet "https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/bronze/parquet_io.py"
click node_initializer "https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/initialize_database.py"
click node_silverrunner "https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/run_silver_pipeline.py"
click node_silveretl "https://github.com/antonia-cordova/neurological-data-lake/tree/develop/scripts/silver"
click node_geography "https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/silver/etl_geography.py"
click node_budget "https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/silver/silver_budget.py"
click node_goldrunner "https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/run_gold_pipeline.py"
click node_goldetl "https://github.com/antonia-cordova/neurological-data-lake/tree/develop/scripts/gold"
click node_runvalidator "https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/gold/silver_run_validator.py"
click node_qualitygen "https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/quality/quality_generator.py"
click node_groundtruth "https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/quality/ground_truth.py"
click node_qualityvalidate "https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/quality/validate_ground_truth.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_dbconfig,node_dbconn,node_initializer toneBlue
class node_landing,node_bronze,node_parquet,node_database toneAmber
class node_silverrunner,node_silveretl,node_geography,node_budget toneMint
class node_goldrunner,node_goldetl,node_runvalidator toneRose
class node_qualitygen,node_groundtruth,node_qualityvalidate,node_operator,node_sources toneIndigo
```

## Components

### Coordinación y configuración

- [Pipeline principal](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/run_pipeline.py): `scripts/run_pipeline.py`
- [Escenarios de BD](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/database_config.py): `scripts/database_config.py`
- [Conexión PostgreSQL](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/database_connection.py): `scripts/database_connection.py`
- [Esquemas y control](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/initialize_database.py): `scripts/initialize_database.py`

### Recepción e ingesta

- [Preparación Landing](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/landing/prepare_landing.py): `scripts/landing/prepare_landing.py`
- [Simulador Bronze](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/bronze/bronze_simulator.py): `scripts/bronze/bronze_simulator.py`
- [Lectura Parquet](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/bronze/parquet_io.py): `scripts/bronze/parquet_io.py`

### Silver normalizado

- [Orquestador Silver](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/run_silver_pipeline.py): `scripts/run_silver_pipeline.py`
- [ETL Silver por fuente](https://github.com/antonia-cordova/neurological-data-lake/tree/develop/scripts/silver): `scripts/silver`
- [Integración geográfica](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/silver/etl_geography.py): `scripts/silver/etl_geography.py`
- [Presupuesto Silver](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/silver/silver_budget.py): `scripts/silver/silver_budget.py`

### Gold analítico

- [Orquestador Gold](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/run_gold_pipeline.py): `scripts/run_gold_pipeline.py`
- [ETL dimensional](https://github.com/antonia-cordova/neurological-data-lake/tree/develop/scripts/gold): `scripts/gold`
- [Validador de ejecuciones](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/gold/silver_run_validator.py): `scripts/gold/silver_run_validator.py`

### Calidad y trazabilidad

- [Degradación controlada](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/quality/quality_generator.py): `scripts/quality/quality_generator.py`
- [Ground Truth](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/quality/ground_truth.py): `scripts/quality/ground_truth.py`
- [Validación Ground Truth](https://github.com/antonia-cordova/neurological-data-lake/blob/develop/scripts/quality/validate_ground_truth.py): `scripts/quality/validate_ground_truth.py`

### Other components

- **Operador**
- **Archivos fuente**
- **PostgreSQL**

## Connections

- Operador → Pipeline principal: inicia (evidence: `README.md`)
- Archivos fuente → Preparación Landing: recibe archivos (evidence: `README.md`)
- Pipeline principal → Simulador Bronze: ejecuta (evidence: `scripts/run_pipeline.py`)
- Pipeline principal → Esquemas y control: inicializa (evidence: `scripts/run_pipeline.py`)
- Pipeline principal → Orquestador Silver: coordina etapas (evidence: `README.md`)
- Pipeline principal → Orquestador Gold: coordina etapas (evidence: `README.md`)
- Preparación Landing → Simulador Bronze: organiza originales (evidence: `README.md`)
- Simulador Bronze → Lectura Parquet: produce Parquet (evidence: `README.md`)
- Simulador Bronze → PostgreSQL: registra ingesta (evidence: `README.md`)
- Esquemas y control → PostgreSQL: crea esquemas (evidence: `README.md`)
- Orquestador Silver → ETL Silver por fuente: ejecuta ETL (evidence: `scripts/run_silver_pipeline.py`)
- ETL Silver por fuente → Lectura Parquet: lee conjuntos (evidence: `scripts/silver/etl_acs.py`)
- ETL Silver por fuente → PostgreSQL: escribe datos (evidence: `README.md`)
- ETL Silver por fuente → Presupuesto Silver: aplica límites (evidence: `scripts/silver/etl_acs.py`)
- Integración geográfica → PostgreSQL: integra geografías (evidence: `scripts/silver/etl_geography.py`)
- Orquestador Gold → ETL dimensional: ejecuta ETL (evidence: `scripts/run_gold_pipeline.py`)
- ETL dimensional → PostgreSQL: lee Silver y carga Gold (evidence: `README.md`)
- ETL dimensional → Validador de ejecuciones: valida ejecución (evidence: `scripts/gold/etl_gold_brfss.py`)
- Orquestador Gold → PostgreSQL: valida y coordina (evidence: `scripts/run_gold_pipeline.py`)
- Degradación controlada → PostgreSQL: degrada escenarios (evidence: `README.md`)
- Degradación controlada → Ground Truth: recupera referencia (evidence: `scripts/quality/quality_generator.py`)
- Validación Ground Truth → PostgreSQL: valida cambios (evidence: `README.md`)
- Validación Ground Truth → Ground Truth: comprueba referencia (evidence: `README.md`)
