# tanishktewetia/consolidapy architecture

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

- Interactive diagram: https://gitdiagram.com/tanishktewetia/consolidapy
- Repository: https://github.com/tanishktewetia/consolidapy

## Overview

ConsolidaPy is a Tkinter desktop tool that turns a folder of Excel workbooks into a combined workbook. The main workflow is folder selection, background consolidation, progress/log feedback, and opening the result. Its processing includes header detection and column canonicalization, while output generation combines data and preserves source-sheet formatting. All runtime responsibilities reside in app.py. The excerpts do not show every internal call, so some processing links rely on the README’s capability descriptions.

Main entry points: [`app.py`](https://github.com/tanishktewetia/consolidapy/blob/main/app.py) (Background worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_gui["Tkinter interface<br/>[app.py]"]
  node_worker["Background worker<br/>[app.py]"]
  node_feedback["Progress and logs<br/>[app.py]"]
  node_open["Open output<br/>[app.py]"]
end

subgraph group_processing["Consolidation processing"]
  node_discovery["Workbook discovery<br/>[app.py]"]
  node_header["Header detection<br/>[app.py]"]
  node_canonical["Column canonicalization<br/>[app.py]"]
  node_merge["Data consolidation<br/>[app.py]"]
  node_sheetcopy["Sheet and style preservation<br/>[app.py]"]
  node_format["Output formatting<br/>[app.py]"]
end

subgraph group_workbooks["Workbook input and output"]
  node_folder["Selected folder"]
  node_source["Source workbooks"]
  node_output["Combined workbook"]
end

node_user(("User"))

node_user -->|"selects folder"| node_gui
node_gui -->|"starts thread"| node_worker
node_worker -->|"discovers files"| node_discovery
node_folder -.->|"contains workbooks"| node_discovery
node_discovery -->|"selects inputs"| node_source
node_source -->|"reads data"| node_header
node_header -.->|"identifies columns"| node_canonical
node_canonical -.->|"normalizes data"| node_merge
node_source -->|"copies original sheets"| node_sheetcopy
node_merge -->|"writes combined sheet"| node_output
node_sheetcopy -->|"preserves sheets"| node_output
node_merge -.->|"formats combined data"| node_format
node_format -->|"styles workbook"| node_output
node_worker -->|"reports progress"| node_feedback
node_user -->|"requests opening"| node_open
node_open -->|"opens workbook"| node_output

click node_gui "https://github.com/tanishktewetia/consolidapy/blob/main/app.py"
click node_worker "https://github.com/tanishktewetia/consolidapy/blob/main/app.py"
click node_feedback "https://github.com/tanishktewetia/consolidapy/blob/main/app.py"
click node_discovery "https://github.com/tanishktewetia/consolidapy/blob/main/app.py"
click node_header "https://github.com/tanishktewetia/consolidapy/blob/main/app.py"
click node_canonical "https://github.com/tanishktewetia/consolidapy/blob/main/app.py"
click node_merge "https://github.com/tanishktewetia/consolidapy/blob/main/app.py"
click node_sheetcopy "https://github.com/tanishktewetia/consolidapy/blob/main/app.py"
click node_format "https://github.com/tanishktewetia/consolidapy/blob/main/app.py"
click node_open "https://github.com/tanishktewetia/consolidapy/blob/main/app.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_gui,node_worker,node_feedback,node_open,node_user toneBlue
class node_discovery,node_header,node_canonical,node_merge,node_sheetcopy,node_format toneAmber
class node_folder,node_source,node_output toneMint
```

## Components

### Desktop interface

- [Tkinter interface](https://github.com/tanishktewetia/consolidapy/blob/main/app.py): `app.py`
- [Background worker](https://github.com/tanishktewetia/consolidapy/blob/main/app.py): `app.py`
- [Progress and logs](https://github.com/tanishktewetia/consolidapy/blob/main/app.py): `app.py`
- [Open output](https://github.com/tanishktewetia/consolidapy/blob/main/app.py): `app.py`

### Consolidation processing

- [Workbook discovery](https://github.com/tanishktewetia/consolidapy/blob/main/app.py): `app.py`
- [Header detection](https://github.com/tanishktewetia/consolidapy/blob/main/app.py): `app.py`
- [Column canonicalization](https://github.com/tanishktewetia/consolidapy/blob/main/app.py): `app.py`
- [Data consolidation](https://github.com/tanishktewetia/consolidapy/blob/main/app.py): `app.py`
- [Sheet and style preservation](https://github.com/tanishktewetia/consolidapy/blob/main/app.py): `app.py`
- [Output formatting](https://github.com/tanishktewetia/consolidapy/blob/main/app.py): `app.py`

### Workbook input and output

- **Selected folder**
- **Source workbooks**
- **Combined workbook**

### Other components

- **User**

## Connections

- User → Tkinter interface: selects folder (evidence: `README.md`)
- Tkinter interface → Background worker: starts thread (evidence: `app.py`)
- Background worker → Workbook discovery: discovers files (evidence: `app.py`)
- Selected folder → Workbook discovery: contains workbooks
- Workbook discovery → Source workbooks: selects inputs (evidence: `app.py`)
- Source workbooks → Header detection: reads data (evidence: `app.py`)
- Header detection → Column canonicalization: identifies columns (evidence: `app.py`)
- Column canonicalization → Data consolidation: normalizes data (evidence: `app.py`)
- Source workbooks → Sheet and style preservation: copies original sheets (evidence: `app.py`)
- Data consolidation → Combined workbook: writes combined sheet (evidence: `README.md`)
- Sheet and style preservation → Combined workbook: preserves sheets (evidence: `README.md`)
- Data consolidation → Output formatting: formats combined data (evidence: `app.py`)
- Output formatting → Combined workbook: styles workbook (evidence: `README.md`)
- Background worker → Progress and logs: reports progress (evidence: `README.md`)
- User → Open output: requests opening (evidence: `README.md`)
- Open output → Combined workbook: opens workbook (evidence: `app.py`)
