# rnd95/sort_disb architecture

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

- Interactive diagram: https://gitdiagram.com/rnd95/sort_disb
- Repository: https://github.com/rnd95/sort_disb

## Overview

sort_disb is a small Python utility that scans district directories, extracts ZIP archives, locates bank folders, and copies their contents into a SORTED hierarchy. Its runtime is implemented entirely in main.py. The README and source excerpt document the workflow and logging; the graph does not imply additional modules or integrations.

Main entry points: [`main.py`](https://github.com/rnd95/sort_disb/blob/main/main.py) (District scan)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_district_inputs(("District folders"))
node_scan_districts["District scan<br/>[main.py]"]
node_extract_archives["ZIP extraction<br/>[main.py]"]
node_find_bank_folders["Bank discovery<br/>[main.py]"]
node_copy_sorted["SORTED copy<br/>[main.py]"]
node_cleanup_temp["Temp cleanup<br/>[main.py]"]
node_log_file["Sorting log"]

node_district_inputs -->|"scans directories"| node_scan_districts
node_scan_districts -->|"finds ZIPs"| node_extract_archives
node_extract_archives -->|"unpacks archives"| node_find_bank_folders
node_find_bank_folders -->|"copies contents"| node_copy_sorted
node_copy_sorted -->|"removes temporary data"| node_cleanup_temp
node_scan_districts -->|"writes messages"| node_log_file
node_extract_archives -->|"logs extraction"| node_log_file
node_copy_sorted -->|"logs errors"| node_log_file

click node_scan_districts "https://github.com/rnd95/sort_disb/blob/main/main.py"
click node_extract_archives "https://github.com/rnd95/sort_disb/blob/main/main.py"
click node_find_bank_folders "https://github.com/rnd95/sort_disb/blob/main/main.py"
click node_copy_sorted "https://github.com/rnd95/sort_disb/blob/main/main.py"
click node_cleanup_temp "https://github.com/rnd95/sort_disb/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_district_inputs,node_log_file toneIndigo
class node_scan_districts,node_extract_archives,node_find_bank_folders,node_copy_sorted,node_cleanup_temp toneTeal
```

## Components

### Other components

- **District folders**
- [District scan](https://github.com/rnd95/sort_disb/blob/main/main.py): `main.py`
- [ZIP extraction](https://github.com/rnd95/sort_disb/blob/main/main.py): `main.py`
- [Bank discovery](https://github.com/rnd95/sort_disb/blob/main/main.py): `main.py`
- [SORTED copy](https://github.com/rnd95/sort_disb/blob/main/main.py): `main.py`
- [Temp cleanup](https://github.com/rnd95/sort_disb/blob/main/main.py): `main.py`
- **Sorting log**

## Connections

- District folders → District scan: scans directories (evidence: `main.py`)
- District scan → ZIP extraction: finds ZIPs (evidence: `main.py`)
- ZIP extraction → Bank discovery: unpacks archives (evidence: `main.py`)
- Bank discovery → SORTED copy: copies contents (evidence: `main.py`)
- SORTED copy → Temp cleanup: removes temporary data (evidence: `main.py`)
- District scan → Sorting log: writes messages (evidence: `main.py`)
- ZIP extraction → Sorting log: logs extraction (evidence: `main.py`)
- SORTED copy → Sorting log: logs errors (evidence: `main.py`)
