# mohamed-fawzyy/bank-etl architecture

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

- Interactive diagram: https://gitdiagram.com/mohamed-fawzyy/bank-etl
- Repository: https://github.com/mohamed-fawzyy/bank-etl

## Overview

This is a small, single-script ETL project: it extracts bank market-capitalization data from a web page, converts values using a supplied exchange-rate CSV, writes the result to CSV and SQLite, and runs summary queries. The script’s top-level code owns the workflow and progress logging. The README also describes managers querying the database; the shown implementation runs fixed queries rather than exposing a manager-facing query interface. Relationships below are based on the script and README, not on unsampled code.

Main entry points: [`banks_project.py`](https://github.com/mohamed-fawzyy/bank-etl/blob/master/banks_project.py) (ETL runner), [`Banks.db`](https://github.com/mohamed-fawzyy/bank-etl/blob/master/Banks.db) (Banks database), [`exchange_rate.csv`](https://github.com/mohamed-fawzyy/bank-etl/blob/master/exchange_rate.csv) (Exchange rates), [`Largest_banks_data.csv`](https://github.com/mohamed-fawzyy/bank-etl/blob/master/Largest_banks_data.csv) (Processed CSV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_etl["ETL workflow"]
  node_runner["ETL runner<br/>[banks_project.py]"]
  node_extract["Extract banks<br/>[banks_project.py]"]
  node_rates["Exchange rates<br/>[exchange_rate.csv]"]
  node_transform["Convert currencies<br/>[banks_project.py]"]
end

subgraph group_storage["Outputs and queries"]
  node_csvload["Write CSV<br/>[banks_project.py]"]
  node_csvout["Processed CSV"]
  node_dbload["Write database<br/>[banks_project.py]"]
  node_db[("Banks database<br/>[Banks.db]")]
  node_query["Run queries<br/>[banks_project.py]"]
end

subgraph group_ops["Progress logging"]
  node_logger["Progress logger<br/>[banks_project.py]"]
  node_logfile["Progress log<br/>[code_log.txt]"]
end

node_web(("Bank data page"))
node_managers(("Country managers"))

node_runner -->|"calls"| node_extract
node_extract -->|"fetches page"| node_web
node_runner -->|"calls"| node_transform
node_transform -->|"reads rates"| node_rates
node_runner -->|"calls"| node_csvload
node_csvload -->|"writes"| node_csvout
node_runner -->|"calls"| node_dbload
node_dbload -->|"writes table"| node_db
node_runner -->|"calls"| node_query
node_query -->|"reads table"| node_db
node_runner -->|"calls"| node_logger
node_logger -->|"appends"| node_logfile
node_managers -.->|"query access"| node_db

click node_runner "https://github.com/mohamed-fawzyy/bank-etl/blob/master/banks_project.py"
click node_extract "https://github.com/mohamed-fawzyy/bank-etl/blob/master/banks_project.py"
click node_rates "https://github.com/mohamed-fawzyy/bank-etl/blob/master/exchange_rate.csv"
click node_transform "https://github.com/mohamed-fawzyy/bank-etl/blob/master/banks_project.py"
click node_csvload "https://github.com/mohamed-fawzyy/bank-etl/blob/master/banks_project.py"
click node_csvout "https://github.com/mohamed-fawzyy/bank-etl/blob/master/Largest_banks_data.csv"
click node_dbload "https://github.com/mohamed-fawzyy/bank-etl/blob/master/banks_project.py"
click node_db "https://github.com/mohamed-fawzyy/bank-etl/blob/master/Banks.db"
click node_query "https://github.com/mohamed-fawzyy/bank-etl/blob/master/banks_project.py"
click node_logger "https://github.com/mohamed-fawzyy/bank-etl/blob/master/banks_project.py"
click node_logfile "https://github.com/mohamed-fawzyy/bank-etl/blob/master/code_log.txt"

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_extract,node_rates,node_transform toneBlue
class node_csvload,node_csvout,node_dbload,node_db,node_query toneAmber
class node_logger,node_logfile toneMint
class node_web,node_managers toneIndigo
```

## Components

### ETL workflow

- [ETL runner](https://github.com/mohamed-fawzyy/bank-etl/blob/master/banks_project.py): `banks_project.py`
- [Extract banks](https://github.com/mohamed-fawzyy/bank-etl/blob/master/banks_project.py): `banks_project.py`
- [Exchange rates](https://github.com/mohamed-fawzyy/bank-etl/blob/master/exchange_rate.csv): `exchange_rate.csv`
- [Convert currencies](https://github.com/mohamed-fawzyy/bank-etl/blob/master/banks_project.py): `banks_project.py`

### Outputs and queries

- [Write CSV](https://github.com/mohamed-fawzyy/bank-etl/blob/master/banks_project.py): `banks_project.py`
- [Processed CSV](https://github.com/mohamed-fawzyy/bank-etl/blob/master/Largest_banks_data.csv): `Largest_banks_data.csv`
- [Write database](https://github.com/mohamed-fawzyy/bank-etl/blob/master/banks_project.py): `banks_project.py`
- [Banks database](https://github.com/mohamed-fawzyy/bank-etl/blob/master/Banks.db): `Banks.db`
- [Run queries](https://github.com/mohamed-fawzyy/bank-etl/blob/master/banks_project.py): `banks_project.py`

### Progress logging

- [Progress logger](https://github.com/mohamed-fawzyy/bank-etl/blob/master/banks_project.py): `banks_project.py`
- [Progress log](https://github.com/mohamed-fawzyy/bank-etl/blob/master/code_log.txt): `code_log.txt`

### Other components

- **Bank data page**
- **Country managers**

## Connections

- ETL runner → Extract banks: calls (evidence: `banks_project.py`)
- Extract banks → Bank data page: fetches page (evidence: `banks_project.py`)
- ETL runner → Convert currencies: calls (evidence: `banks_project.py`)
- Convert currencies → Exchange rates: reads rates (evidence: `banks_project.py`)
- ETL runner → Write CSV: calls (evidence: `banks_project.py`)
- Write CSV → Processed CSV: writes (evidence: `banks_project.py`)
- ETL runner → Write database: calls (evidence: `banks_project.py`)
- Write database → Banks database: writes table (evidence: `banks_project.py`)
- ETL runner → Run queries: calls (evidence: `banks_project.py`)
- Run queries → Banks database: reads table (evidence: `banks_project.py`)
- ETL runner → Progress logger: calls (evidence: `banks_project.py`)
- Progress logger → Progress log: appends (evidence: `banks_project.py`)
- Country managers → Banks database: query access (evidence: `README.md`)
