# 0nrr/python-calculator architecture

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

- Interactive diagram: https://gitdiagram.com/0nrr/python-calculator
- Repository: https://github.com/0nrr/python-calculator

## Overview

This is a small interactive terminal calculator. The user selects an arithmetic operation, enters two values, and sees the result in colored output; integer or float conversion is chosen by checking for decimal points. The runtime is contained in one script, so the graph keeps the input loop, operation handling, and presentation together rather than implying separate modules. Evidence is limited to the README and the sole sampled source file.

Main entry points: [`python-calculator.py`](https://github.com/0nrr/python-calculator/blob/main/python-calculator.py) (Interactive calculator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Calculator runtime"]
  node_calculator["Interactive calculator"]
  node_arithmetic["Arithmetic operations"]
end

node_user(("Terminal user"))
node_terminal(("Terminal output"))

node_user -->|"enters choices and values"| node_calculator
node_calculator -->|"dispatches operation"| node_arithmetic
node_calculator -->|"prints menu and results"| node_terminal

click node_calculator "https://github.com/0nrr/python-calculator/blob/main/python-calculator.py"
click node_arithmetic "https://github.com/0nrr/python-calculator/blob/main/python-calculator.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_calculator,node_arithmetic,node_user toneBlue
class node_terminal toneIndigo
```

## Components

### Calculator runtime

- [Interactive calculator](https://github.com/0nrr/python-calculator/blob/main/python-calculator.py): `python-calculator.py`
- [Arithmetic operations](https://github.com/0nrr/python-calculator/blob/main/python-calculator.py): `python-calculator.py`

### Other components

- **Terminal user**
- **Terminal output**

## Connections

- Terminal user → Interactive calculator: enters choices and values (evidence: `python-calculator.py`)
- Interactive calculator → Arithmetic operations: dispatches operation (evidence: `python-calculator.py`)
- Interactive calculator → Terminal output: prints menu and results (evidence: `python-calculator.py`)
