# mitsuki31/xls2csv architecture

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

- Interactive diagram: https://gitdiagram.com/mitsuki31/xls2csv
- Repository: https://github.com/mitsuki31/xls2csv

## Overview

xls2csv is a command-line Excel-to-CSV backup utility. A user supplies a file or directory and conversion options; the CLI validates and dispatches to single-file or recursive batch conversion. Conversion reads workbook values, selects active, named, or all sheets, formats output names, and writes UTF-8 CSV files. The converter uses shared path and naming utilities and raises structured errors that the CLI formats for terminal output. The README documents these modes and options; edges reflect calls visible in the excerpts.

Main entry points: [`xls2csv/converter.py`](https://github.com/mitsuki31/xls2csv/blob/master/xls2csv/converter.py) (Workbook conversion), [`xls2csv/cli.py`](https://github.com/mitsuki31/xls2csv/blob/master/xls2csv/cli.py) (Command interface), [`xls2csv/exception.py`](https://github.com/mitsuki31/xls2csv/blob/master/xls2csv/exception.py) (Conversion errors), [`xls2csv/utils.py`](https://github.com/mitsuki31/xls2csv/blob/master/xls2csv/utils.py) (Naming and discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_cli["Command interface<br/>[cli.py]"]
end

subgraph group_conversion["Conversion"]
  node_converter["Workbook conversion<br/>[converter.py]"]
end

subgraph group_support["Shared support"]
  node_utilities["Naming and discovery<br/>[utils.py]"]
  node_errors["Conversion errors<br/>[exception.py]"]
end

node_user(("CLI user"))
node_excel["Excel workbooks"]
node_csv["CSV output files"]
node_openpyxl["openpyxl reader"]

node_user -->|"invokes"| node_cli
node_cli -->|"dispatches"| node_converter
node_cli -->|"formats errors"| node_errors
node_converter -->|"loads workbook"| node_openpyxl
node_excel -->|"provides workbook"| node_converter
node_converter -->|"uses helpers"| node_utilities
node_converter -->|"raises"| node_errors
node_converter -->|"writes sheets"| node_csv

click node_cli "https://github.com/mitsuki31/xls2csv/blob/master/xls2csv/cli.py"
click node_converter "https://github.com/mitsuki31/xls2csv/blob/master/xls2csv/converter.py"
click node_utilities "https://github.com/mitsuki31/xls2csv/blob/master/xls2csv/utils.py"
click node_errors "https://github.com/mitsuki31/xls2csv/blob/master/xls2csv/exception.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_user toneBlue
class node_converter toneAmber
class node_utilities,node_errors toneMint
class node_excel,node_csv,node_openpyxl toneIndigo
```

## Components

### CLI entry

- [Command interface](https://github.com/mitsuki31/xls2csv/blob/master/xls2csv/cli.py): `xls2csv/cli.py`

### Conversion

- [Workbook conversion](https://github.com/mitsuki31/xls2csv/blob/master/xls2csv/converter.py): `xls2csv/converter.py`

### Shared support

- [Naming and discovery](https://github.com/mitsuki31/xls2csv/blob/master/xls2csv/utils.py): `xls2csv/utils.py`
- [Conversion errors](https://github.com/mitsuki31/xls2csv/blob/master/xls2csv/exception.py): `xls2csv/exception.py`

### Other components

- **CLI user**
- **Excel workbooks**
- **CSV output files**
- **openpyxl reader**

## Connections

- CLI user → Command interface: invokes (evidence: `README.md`)
- Command interface → Workbook conversion: dispatches (evidence: `xls2csv/cli.py`)
- Command interface → Conversion errors: formats errors (evidence: `xls2csv/cli.py`)
- Workbook conversion → openpyxl reader: loads workbook (evidence: `xls2csv/converter.py`)
- Excel workbooks → Workbook conversion: provides workbook (evidence: `xls2csv/converter.py`)
- Workbook conversion → Naming and discovery: uses helpers (evidence: `xls2csv/converter.py`)
- Workbook conversion → Conversion errors: raises (evidence: `xls2csv/converter.py`)
- Workbook conversion → CSV output files: writes sheets (evidence: `xls2csv/converter.py`)
