# hussamshebrawi/student-records-cleaner architecture

> Architecture diagram of the GitHub repository hussamshebrawi/student-records-cleaner, 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/hussamshebrawi/student-records-cleaner
- Repository: https://github.com/hussamshebrawi/student-records-cleaner

## Overview

Student Records Cleaner is a small command-line CSV cleaning script. The workflow starts with CLI arguments, reads a header and rows, applies ordered row-shape and data-quality checks, writes accepted rows, and logs rejected rows and a summary. Validation helpers and the CLI/error-handling layer are shown separately; the checks themselves are stages within the single cleaner, not independent services. The graph is based on the README and the excerpted main.py; no additional runtime modules were identified.

Main entry points: [`main.py`](https://github.com/hussamshebrawi/student-records-cleaner/blob/main/main.py) (CSV cleaner), [`data/students.csv`](https://github.com/hussamshebrawi/student-records-cleaner/blob/main/data/students.csv) (Input CSV), [`data/students_cleaned.csv`](https://github.com/hussamshebrawi/student-records-cleaner/blob/main/data/students_cleaned.csv) (Cleaned CSV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and errors"]
  node_cli["Argument parsing and error handling<br/>[main.py]"]
end

subgraph group_cleaning["CSV cleaning"]
  node_cleaner["CSV cleaner<br/>[main.py]"]
  node_row_checks["Row checks<br/>[main.py]"]
  node_empty_cells["Empty-cell detection<br/>[main.py]"]
  node_age_check["Age validation<br/>[main.py]"]
  node_email_check["Email validation<br/>[main.py]"]
end

subgraph group_outputs["Files and reporting"]
  node_summary["Run summary<br/>[main.py]"]
  node_input_csv["Input CSV<br/>[students.csv]"]
  node_output_csv["Cleaned CSV"]
  node_log_file["Rejection log"]
end

node_user(("CLI user"))

node_user -->|"runs"| node_cli
node_cli -->|"calls"| node_cleaner
node_cli -->|"configures"| node_log_file
node_cleaner -->|"reads"| node_input_csv
node_cleaner -->|"checks rows"| node_row_checks
node_cleaner -->|"detects empties"| node_empty_cells
node_cleaner -->|"validates age"| node_age_check
node_cleaner -->|"validates email"| node_email_check
node_cleaner -->|"writes valid rows"| node_output_csv
node_cleaner -->|"logs rejected rows"| node_log_file
node_cleaner -->|"reports counts"| node_summary

click node_cli "https://github.com/hussamshebrawi/student-records-cleaner/blob/main/main.py"
click node_cleaner "https://github.com/hussamshebrawi/student-records-cleaner/blob/main/main.py"
click node_row_checks "https://github.com/hussamshebrawi/student-records-cleaner/blob/main/main.py"
click node_empty_cells "https://github.com/hussamshebrawi/student-records-cleaner/blob/main/main.py"
click node_age_check "https://github.com/hussamshebrawi/student-records-cleaner/blob/main/main.py"
click node_email_check "https://github.com/hussamshebrawi/student-records-cleaner/blob/main/main.py"
click node_summary "https://github.com/hussamshebrawi/student-records-cleaner/blob/main/main.py"
click node_input_csv "https://github.com/hussamshebrawi/student-records-cleaner/blob/main/data/students.csv"
click node_output_csv "https://github.com/hussamshebrawi/student-records-cleaner/blob/main/data/students_cleaned.csv"

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_cli,node_user toneBlue
class node_cleaner,node_row_checks,node_empty_cells,node_age_check,node_email_check toneAmber
class node_summary,node_input_csv,node_output_csv,node_log_file toneMint
```

## Components

### CLI and errors

- [Argument parsing and error handling](https://github.com/hussamshebrawi/student-records-cleaner/blob/main/main.py): `main.py`

### CSV cleaning

- [CSV cleaner](https://github.com/hussamshebrawi/student-records-cleaner/blob/main/main.py): `main.py`
- [Row checks](https://github.com/hussamshebrawi/student-records-cleaner/blob/main/main.py): `main.py`
- [Empty-cell detection](https://github.com/hussamshebrawi/student-records-cleaner/blob/main/main.py): `main.py`
- [Age validation](https://github.com/hussamshebrawi/student-records-cleaner/blob/main/main.py): `main.py`
- [Email validation](https://github.com/hussamshebrawi/student-records-cleaner/blob/main/main.py): `main.py`

### Files and reporting

- [Run summary](https://github.com/hussamshebrawi/student-records-cleaner/blob/main/main.py): `main.py`
- [Input CSV](https://github.com/hussamshebrawi/student-records-cleaner/blob/main/data/students.csv): `data/students.csv`
- [Cleaned CSV](https://github.com/hussamshebrawi/student-records-cleaner/blob/main/data/students_cleaned.csv): `data/students_cleaned.csv`
- **Rejection log**

### Other components

- **CLI user**

## Connections

- CLI user → Argument parsing and error handling: runs (evidence: `README.md`)
- Argument parsing and error handling → CSV cleaner: calls (evidence: `main.py`)
- Argument parsing and error handling → Rejection log: configures (evidence: `main.py`)
- CSV cleaner → Input CSV: reads (evidence: `main.py`)
- CSV cleaner → Row checks: checks rows (evidence: `main.py`)
- CSV cleaner → Empty-cell detection: detects empties (evidence: `main.py`)
- CSV cleaner → Age validation: validates age (evidence: `main.py`)
- CSV cleaner → Email validation: validates email (evidence: `main.py`)
- CSV cleaner → Cleaned CSV: writes valid rows (evidence: `main.py`)
- CSV cleaner → Rejection log: logs rejected rows (evidence: `main.py`)
- CSV cleaner → Run summary: reports counts (evidence: `main.py`)
