# rakesh-dogga/python-unit-converter architecture

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

- Interactive diagram: https://gitdiagram.com/rakesh-dogga/python-unit-converter
- Repository: https://github.com/rakesh-dogga/python-unit-converter

## Overview

This is a small, single-file terminal unit converter. The user selects a conversion category, enters source and target units plus a value, and receives a converted result or a validation error. Five domain-specific conversion functions cover length, temperature, speed, time, and volume; category-specific runners connect shared input collection to those functions. All relationships shown are visible in main.py; the graph reflects the implementation rather than adding separate subsystems.

Main entry points: [`main.py`](https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py) (Menu and dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("Terminal user"))
node_cli["Menu and dispatch<br/>[main.py]"]
node_inputs["Unit input<br/>[main.py]"]
node_length["Length conversion<br/>[main.py]"]
node_temperature["Temperature conversion<br/>[main.py]"]
node_speed["Speed conversion<br/>[main.py]"]
node_time["Time conversion<br/>[main.py]"]
node_volume["Volume conversion<br/>[main.py]"]
node_result["Result and errors<br/>[main.py]"]

node_user -->|"selects category"| node_cli
node_cli -->|"dispatches"| node_length
node_cli -->|"dispatches"| node_temperature
node_cli -->|"dispatches"| node_speed
node_cli -->|"dispatches"| node_time
node_cli -->|"dispatches"| node_volume
node_length -->|"collects"| node_inputs
node_temperature -->|"collects"| node_inputs
node_speed -->|"collects"| node_inputs
node_time -->|"collects"| node_inputs
node_volume -->|"collects"| node_inputs
node_length -->|"returns result"| node_result
node_temperature -->|"returns result"| node_result
node_speed -->|"returns result"| node_result
node_time -->|"returns result"| node_result
node_volume -->|"returns result"| node_result
node_cli -->|"prints result or error"| node_result

click node_cli "https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py"
click node_inputs "https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py"
click node_length "https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py"
click node_temperature "https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py"
click node_speed "https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py"
click node_time "https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py"
click node_volume "https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py"
click node_result "https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.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_user toneBlue
class node_cli,node_inputs,node_length,node_temperature,node_speed,node_time,node_volume,node_result toneTeal
```

## Components

### Other components

- **Terminal user**
- [Menu and dispatch](https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py): `main.py`
- [Unit input](https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py): `main.py`
- [Length conversion](https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py): `main.py`
- [Temperature conversion](https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py): `main.py`
- [Speed conversion](https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py): `main.py`
- [Time conversion](https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py): `main.py`
- [Volume conversion](https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py): `main.py`
- [Result and errors](https://github.com/rakesh-dogga/python-unit-converter/blob/main/main.py): `main.py`

## Connections

- Terminal user → Menu and dispatch: selects category (evidence: `README.md`)
- Menu and dispatch → Length conversion: dispatches (evidence: `main.py`)
- Menu and dispatch → Temperature conversion: dispatches (evidence: `main.py`)
- Menu and dispatch → Speed conversion: dispatches (evidence: `main.py`)
- Menu and dispatch → Time conversion: dispatches (evidence: `main.py`)
- Menu and dispatch → Volume conversion: dispatches (evidence: `main.py`)
- Length conversion → Unit input: collects (evidence: `main.py`)
- Temperature conversion → Unit input: collects (evidence: `main.py`)
- Speed conversion → Unit input: collects (evidence: `main.py`)
- Time conversion → Unit input: collects (evidence: `main.py`)
- Volume conversion → Unit input: collects (evidence: `main.py`)
- Length conversion → Result and errors: returns result (evidence: `main.py`)
- Temperature conversion → Result and errors: returns result (evidence: `main.py`)
- Speed conversion → Result and errors: returns result (evidence: `main.py`)
- Time conversion → Result and errors: returns result (evidence: `main.py`)
- Volume conversion → Result and errors: returns result (evidence: `main.py`)
- Menu and dispatch → Result and errors: prints result or error (evidence: `main.py`)
