# huzaifa931/crypto-etl-pipeline architecture

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

- Interactive diagram: https://gitdiagram.com/huzaifa931/crypto-etl-pipeline
- Repository: https://github.com/huzaifa931/crypto-etl-pipeline

## Overview

This is a small cryptocurrency market ETL application. A user or scheduler starts the pipeline, which fetches CoinGecko market data, cleans and timestamps it, then appends history to SQLite and exports the latest run as CSV. Configuration supplies API and storage settings, while shared logging supports the stages and orchestrator. The excerpts show the principal calls and persistence operations; generated data files are documented outputs, not files in the supplied tree.

Main entry points: [`pipeline.py`](https://github.com/huzaifa931/crypto-etl-pipeline/blob/main/pipeline.py) (Pipeline runner), [`load.py`](https://github.com/huzaifa931/crypto-etl-pipeline/blob/main/load.py) (Data loading and export), [`logger.py`](https://github.com/huzaifa931/crypto-etl-pipeline/blob/main/logger.py) (Shared logging), [`extract.py`](https://github.com/huzaifa931/crypto-etl-pipeline/blob/main/extract.py) (Market extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Orchestration"]
  node_pipeline["Pipeline runner<br/>[pipeline.py]"]
end

subgraph group_etl["ETL stages"]
  node_extract["Market extraction<br/>[extract.py]"]
  node_transform["Data cleaning<br/>[transform.py]"]
  node_load["Data loading and export<br/>[load.py]"]
end

subgraph group_support["Shared support"]
  node_config["Pipeline configuration<br/>[config.py]"]
  node_logger["Shared logging<br/>[logger.py]"]
end

subgraph group_outputs["Data outputs"]
  node_sqlite[("SQLite history")]
  node_csv["Latest CSV snapshot"]
end

node_scheduler(("User or scheduler"))
node_coingecko{{"CoinGecko API"}}

node_scheduler -->|"runs"| node_pipeline
node_pipeline -->|"fetches data"| node_extract
node_extract -->|"requests market data"| node_coingecko
node_pipeline -->|"cleans records"| node_transform
node_pipeline -->|"loads and exports"| node_load
node_extract -->|"uses API settings"| node_config
node_load -->|"uses output paths"| node_config
node_extract -->|"logs activity"| node_logger
node_transform -->|"logs activity"| node_logger
node_load -->|"logs activity"| node_logger
node_pipeline -->|"logs run"| node_logger
node_logger -->|"uses log path"| node_config
node_load -->|"appends history"| node_sqlite
node_load -->|"writes snapshot"| node_csv

click node_pipeline "https://github.com/huzaifa931/crypto-etl-pipeline/blob/main/pipeline.py"
click node_extract "https://github.com/huzaifa931/crypto-etl-pipeline/blob/main/extract.py"
click node_transform "https://github.com/huzaifa931/crypto-etl-pipeline/blob/main/transform.py"
click node_load "https://github.com/huzaifa931/crypto-etl-pipeline/blob/main/load.py"
click node_config "https://github.com/huzaifa931/crypto-etl-pipeline/blob/main/config.py"
click node_logger "https://github.com/huzaifa931/crypto-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_pipeline toneBlue
class node_extract,node_transform,node_load toneAmber
class node_config,node_logger,node_coingecko toneMint
class node_sqlite,node_csv,node_scheduler toneRose
```

## Components

### Orchestration

- [Pipeline runner](https://github.com/huzaifa931/crypto-etl-pipeline/blob/main/pipeline.py): `pipeline.py`

### ETL stages

- [Market extraction](https://github.com/huzaifa931/crypto-etl-pipeline/blob/main/extract.py): `extract.py`
- [Data cleaning](https://github.com/huzaifa931/crypto-etl-pipeline/blob/main/transform.py): `transform.py`
- [Data loading and export](https://github.com/huzaifa931/crypto-etl-pipeline/blob/main/load.py): `load.py`

### Shared support

- [Pipeline configuration](https://github.com/huzaifa931/crypto-etl-pipeline/blob/main/config.py): `config.py`
- [Shared logging](https://github.com/huzaifa931/crypto-etl-pipeline/blob/main/logger.py): `logger.py`

### Data outputs

- **SQLite history**
- **Latest CSV snapshot**

### Other components

- **User or scheduler**
- **CoinGecko API**

## Connections

- User or scheduler → Pipeline runner: runs (evidence: `README.md`)
- Pipeline runner → Market extraction: fetches data (evidence: `pipeline.py`)
- Market extraction → CoinGecko API: requests market data (evidence: `extract.py`)
- Pipeline runner → Data cleaning: cleans records (evidence: `pipeline.py`)
- Pipeline runner → Data loading and export: loads and exports (evidence: `pipeline.py`)
- Market extraction → Pipeline configuration: uses API settings (evidence: `extract.py`)
- Data loading and export → Pipeline configuration: uses output paths (evidence: `load.py`)
- Market extraction → Shared logging: logs activity (evidence: `extract.py`)
- Data cleaning → Shared logging: logs activity (evidence: `transform.py`)
- Data loading and export → Shared logging: logs activity (evidence: `load.py`)
- Pipeline runner → Shared logging: logs run (evidence: `pipeline.py`)
- Shared logging → Pipeline configuration: uses log path (evidence: `logger.py`)
- Data loading and export → SQLite history: appends history (evidence: `load.py`)
- Data loading and export → Latest CSV snapshot: writes snapshot (evidence: `load.py`)
