# tiwariajayvirendra/etl_pipeline architecture

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

- Interactive diagram: https://gitdiagram.com/tiwariajayvirendra/etl_pipeline
- Repository: https://github.com/tiwariajayvirendra/etl_pipeline

## Overview

ETLProject cleans order data from a source CSV, quarantines invalid rows, and writes cleaned CSV output with an optional database load. Its main workflow can run directly or be scheduled by Airflow. The README also describes automatic parser discovery and Docker-based Airflow operation. Parser modules are grouped by their cleaning responsibility; the available source excerpts show dynamic discovery and individual cleaning/quarantine behavior, but not every parser’s implementation. The commented ingestion helper is not part of the active workflow.

Main entry points: [`pipeline.py`](https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/pipeline.py) (ETL pipeline), [`dag.py`](https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/dag.py) (ETL DAG), [`config.py`](https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/config.py) (Runtime configuration), [`parsers/parse_date.py`](https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/parsers/parse_date.py) (Date cleaning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Orchestration"]
  node_airflow["Airflow scheduler"]
  node_dag["ETL DAG<br/>[dag.py]"]
  node_pipeline["ETL pipeline<br/>[pipeline.py]"]
end

subgraph group_processing["Data processing"]
  node_source["Source CSV"]
  node_date_parser["Date cleaning<br/>[parse_date.py]"]
  node_identity_parser["Identity cleaning"]
  node_order_parsers["Order field cleaning"]
end

subgraph group_outputs["Data outputs"]
  node_clean_csv["Cleaned CSV"]
  node_quarantine["Quarantine CSVs"]
  node_database[("SQL database")]
end

subgraph group_configuration["Configuration"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_logger["Pipeline logging<br/>[logger.py]"]
end

node_operator(("Operator"))

node_operator -->|"triggers DAG"| node_airflow
node_airflow -->|"schedules"| node_dag
node_dag -->|"runs pipeline"| node_pipeline
node_pipeline -->|"reads CSV"| node_source
node_pipeline -->|"discovers and runs"| node_date_parser
node_pipeline -->|"discovers and runs"| node_identity_parser
node_pipeline -->|"discovers and runs"| node_order_parsers
node_date_parser -->|"writes invalid rows"| node_quarantine
node_identity_parser -->|"writes invalid rows"| node_quarantine
node_order_parsers -->|"quarantines invalid rows"| node_quarantine
node_pipeline -->|"writes cleaned data"| node_clean_csv
node_pipeline -->|"optionally loads"| node_database
node_pipeline -->|"reads settings"| node_config
node_dag -->|"reads schedule settings"| node_config
node_pipeline -->|"gets logger"| node_logger
node_logger -->|"reads log path"| node_config

click node_dag "https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/dag.py"
click node_pipeline "https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/pipeline.py"
click node_date_parser "https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/parsers/parse_date.py"
click node_identity_parser "https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/parsers/parse_customer_id.py"
click node_order_parsers "https://github.com/tiwariajayvirendra/etl_pipeline/tree/main/parsers"
click node_config "https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/config.py"
click node_logger "https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/logger.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_airflow,node_dag,node_pipeline toneBlue
class node_source,node_date_parser,node_identity_parser,node_order_parsers toneAmber
class node_clean_csv,node_quarantine,node_database toneMint
class node_config,node_logger toneRose
class node_operator toneIndigo
```

## Components

### Orchestration

- **Airflow scheduler**
- [ETL DAG](https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/dag.py): `dag.py`
- [ETL pipeline](https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/pipeline.py): `pipeline.py`

### Data processing

- **Source CSV**
- [Date cleaning](https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/parsers/parse_date.py): `parsers/parse_date.py`
- [Identity cleaning](https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/parsers/parse_customer_id.py): `parsers/parse_customer_id.py`
- [Order field cleaning](https://github.com/tiwariajayvirendra/etl_pipeline/tree/main/parsers): `parsers`

### Data outputs

- **Cleaned CSV**
- **Quarantine CSVs**
- **SQL database**

### Configuration

- [Runtime configuration](https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/config.py): `config.py`
- [Pipeline logging](https://github.com/tiwariajayvirendra/etl_pipeline/blob/main/logger.py): `logger.py`

### Other components

- **Operator**

## Connections

- Operator → Airflow scheduler: triggers DAG (evidence: `README.md`)
- Airflow scheduler → ETL DAG: schedules (evidence: `README.md`)
- ETL DAG → ETL pipeline: runs pipeline (evidence: `dag.py`)
- ETL pipeline → Source CSV: reads CSV (evidence: `pipeline.py`)
- ETL pipeline → Date cleaning: discovers and runs (evidence: `pipeline.py`)
- ETL pipeline → Identity cleaning: discovers and runs (evidence: `pipeline.py`)
- ETL pipeline → Order field cleaning: discovers and runs (evidence: `pipeline.py`)
- Date cleaning → Quarantine CSVs: writes invalid rows (evidence: `parsers/parse_date.py`)
- Identity cleaning → Quarantine CSVs: writes invalid rows (evidence: `parsers/parse_customer_id.py`)
- Order field cleaning → Quarantine CSVs: quarantines invalid rows (evidence: `README.md`)
- ETL pipeline → Cleaned CSV: writes cleaned data (evidence: `pipeline.py`)
- ETL pipeline → SQL database: optionally loads (evidence: `pipeline.py`)
- ETL pipeline → Runtime configuration: reads settings (evidence: `pipeline.py`)
- ETL DAG → Runtime configuration: reads schedule settings (evidence: `dag.py`)
- ETL pipeline → Pipeline logging: gets logger (evidence: `pipeline.py`)
- Pipeline logging → Runtime configuration: reads log path (evidence: `logger.py`)
