# radhwane-py/messy_data_cleaner architecture

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

- Interactive diagram: https://gitdiagram.com/radhwane-py/messy_data_cleaner
- Repository: https://github.com/radhwane-py/messy_data_cleaner

## Overview

Messy Data Cleaner is a configurable CSV/Excel cleaning tool. Users can inspect a dataset with the exploration CLI or run the cleaning CLI with a YAML rules file; the pipeline loads data, profiles it, applies configured cleaning steps, validates it, profiles the result, and saves it. The graph shows the distinct processing stages and the I/O and profiling layers. Relationships are based on the shown source excerpts and README; configuration-driven behavior is shown only where documented or visible in the CLI and pipeline.

Main entry points: [`src/cleaner/pipeline.py`](https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/pipeline.py) (Cleaning pipeline), [`clean.py`](https://github.com/radhwane-py/messy_data_cleaner/blob/master/clean.py) (Cleaning CLI), [`explore.py`](https://github.com/radhwane-py/messy_data_cleaner/blob/master/explore.py) (Explore CLI), [`src/cleaner/io_utils.py`](https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/io_utils.py) (Data loading)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_clean_cli["Cleaning CLI<br/>[clean.py]"]
  node_explore_cli["Explore CLI<br/>[explore.py]"]
end

subgraph group_pipeline["Pipeline orchestration"]
  node_pipeline["Cleaning pipeline<br/>[pipeline.py]"]
end

subgraph group_processing["Data processing"]
  node_loader["Data loading<br/>[io_utils.py]"]
  node_profiler["Dataset profiling<br/>[profiling.py]"]
  node_standardize["Column standardization<br/>[cleaning.py]"]
  node_normalize_types["Text and types<br/>[cleaning.py]"]
  node_missing_duplicates["Missing and duplicates<br/>[cleaning.py]"]
  node_outliers["Outlier removal<br/>[cleaning.py]"]
  node_validator["Data validation<br/>[validation.py]"]
  node_saver["Data saving<br/>[io_utils.py]"]
end

subgraph group_configuration["Rules and outputs"]
  node_config["YAML rules"]
end

node_user(("User"))
node_raw_data["Input dataset"]
node_clean_data["Cleaned dataset"]

node_user -->|"runs"| node_clean_cli
node_user -->|"runs"| node_explore_cli
node_clean_cli -->|"loads rules"| node_config
node_clean_cli -->|"runs"| node_pipeline
node_explore_cli -->|"loads data"| node_loader
node_explore_cli -->|"profiles data"| node_profiler
node_raw_data -->|"read by"| node_loader
node_pipeline -->|"loads data"| node_loader
node_pipeline -->|"profiles data"| node_profiler
node_pipeline -->|"standardizes columns"| node_standardize
node_pipeline -->|"normalizes and converts"| node_normalize_types
node_pipeline -->|"handles missing and duplicates"| node_missing_duplicates
node_pipeline -->|"removes outliers"| node_outliers
node_pipeline -->|"validates data"| node_validator
node_pipeline -->|"saves data"| node_saver
node_saver -->|"writes"| node_clean_data

click node_clean_cli "https://github.com/radhwane-py/messy_data_cleaner/blob/master/clean.py"
click node_explore_cli "https://github.com/radhwane-py/messy_data_cleaner/blob/master/explore.py"
click node_pipeline "https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/pipeline.py"
click node_loader "https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/io_utils.py"
click node_profiler "https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/profiling.py"
click node_standardize "https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/cleaning.py"
click node_normalize_types "https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/cleaning.py"
click node_missing_duplicates "https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/cleaning.py"
click node_outliers "https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/cleaning.py"
click node_validator "https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/validation.py"
click node_saver "https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/io_utils.py"
click node_config "https://github.com/radhwane-py/messy_data_cleaner/blob/master/config/default_config.yaml"

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_clean_cli,node_explore_cli,node_user toneBlue
class node_pipeline toneAmber
class node_loader,node_profiler,node_standardize,node_normalize_types,node_missing_duplicates,node_outliers,node_validator,node_saver toneMint
class node_config toneRose
class node_raw_data,node_clean_data toneIndigo
```

## Components

### User interfaces

- [Cleaning CLI](https://github.com/radhwane-py/messy_data_cleaner/blob/master/clean.py): `clean.py`
- [Explore CLI](https://github.com/radhwane-py/messy_data_cleaner/blob/master/explore.py): `explore.py`

### Pipeline orchestration

- [Cleaning pipeline](https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/pipeline.py): `src/cleaner/pipeline.py`

### Data processing

- [Data loading](https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/io_utils.py): `src/cleaner/io_utils.py`
- [Dataset profiling](https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/profiling.py): `src/cleaner/profiling.py`
- [Column standardization](https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/cleaning.py): `src/cleaner/cleaning.py`
- [Text and types](https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/cleaning.py): `src/cleaner/cleaning.py`
- [Missing and duplicates](https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/cleaning.py): `src/cleaner/cleaning.py`
- [Outlier removal](https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/cleaning.py): `src/cleaner/cleaning.py`
- [Data validation](https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/validation.py): `src/cleaner/validation.py`
- [Data saving](https://github.com/radhwane-py/messy_data_cleaner/blob/master/src/cleaner/io_utils.py): `src/cleaner/io_utils.py`

### Rules and outputs

- [YAML rules](https://github.com/radhwane-py/messy_data_cleaner/blob/master/config/default_config.yaml): `config/default_config.yaml`

### Other components

- **User**
- **Input dataset**
- **Cleaned dataset**

## Connections

- User → Cleaning CLI: runs (evidence: `README.md`)
- User → Explore CLI: runs (evidence: `README.md`)
- Cleaning CLI → YAML rules: loads rules (evidence: `clean.py`)
- Cleaning CLI → Cleaning pipeline: runs (evidence: `clean.py`)
- Explore CLI → Data loading: loads data (evidence: `explore.py`)
- Explore CLI → Dataset profiling: profiles data (evidence: `explore.py`)
- Input dataset → Data loading: read by
- Cleaning pipeline → Data loading: loads data (evidence: `src/cleaner/pipeline.py`)
- Cleaning pipeline → Dataset profiling: profiles data (evidence: `src/cleaner/pipeline.py`)
- Cleaning pipeline → Column standardization: standardizes columns (evidence: `src/cleaner/pipeline.py`)
- Cleaning pipeline → Text and types: normalizes and converts (evidence: `src/cleaner/pipeline.py`)
- Cleaning pipeline → Missing and duplicates: handles missing and duplicates (evidence: `src/cleaner/pipeline.py`)
- Cleaning pipeline → Outlier removal: removes outliers (evidence: `src/cleaner/pipeline.py`)
- Cleaning pipeline → Data validation: validates data (evidence: `src/cleaner/pipeline.py`)
- Cleaning pipeline → Data saving: saves data (evidence: `src/cleaner/pipeline.py`)
- Data saving → Cleaned dataset: writes
