# shubhrajitsamal7-data/complex-calculator architecture

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

- Interactive diagram: https://gitdiagram.com/shubhrajitsamal7-data/complex-calculator
- Repository: https://github.com/shubhrajitsamal7-data/complex-calculator

## Overview

A small command-line complex-number-capable arithmetic calculator: users enter expressions, the CLI passes them to Calculator, which parses and safely evaluates supported arithmetic, constants, and math functions, then prints a result or error. The sole source file contains both the CLI and evaluator; no separate storage or service layer is present.

Main entry points: [`complex calc.py`](https://github.com/shubhrajitsamal7-data/complex-calculator/blob/main/complex%20calc.py) (Expression evaluator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Calculator runtime"]
  node_cli["Interactive CLI<br/>[complex calc.py]"]
  node_calculator["Expression evaluator<br/>[complex calc.py]"]
end

node_user(("CLI user"))
node_python_ast["Python AST parser"]
node_math["Math operations"]

node_user -->|"enters expression"| node_cli
node_cli -->|"calculates"| node_calculator
node_calculator -->|"parses expression"| node_python_ast
node_calculator -->|"uses functions"| node_math
node_calculator -->|"returns result"| node_cli
node_cli -->|"prints result"| node_user

click node_cli "https://github.com/shubhrajitsamal7-data/complex-calculator/blob/main/complex%20calc.py"
click node_calculator "https://github.com/shubhrajitsamal7-data/complex-calculator/blob/main/complex%20calc.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_cli,node_calculator,node_user toneBlue
class node_python_ast,node_math toneIndigo
```

## Components

### Calculator runtime

- [Interactive CLI](https://github.com/shubhrajitsamal7-data/complex-calculator/blob/main/complex%20calc.py): `complex calc.py`
- [Expression evaluator](https://github.com/shubhrajitsamal7-data/complex-calculator/blob/main/complex%20calc.py): `complex calc.py`

### Other components

- **CLI user**
- **Python AST parser**
- **Math operations**

## Connections

- CLI user → Interactive CLI: enters expression (evidence: `complex calc.py`)
- Interactive CLI → Expression evaluator: calculates (evidence: `complex calc.py`)
- Expression evaluator → Python AST parser: parses expression (evidence: `complex calc.py`)
- Expression evaluator → Math operations: uses functions (evidence: `complex calc.py`)
- Expression evaluator → Interactive CLI: returns result (evidence: `complex calc.py`)
- Interactive CLI → CLI user: prints result (evidence: `complex calc.py`)
