# elisonrj/xml2xlsx architecture

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

- Interactive diagram: https://gitdiagram.com/elisonrj/xml2xlsx
- Repository: https://github.com/elisonrj/xml2xlsx

## Overview

This small script converts XML electronic invoices into an XLSX spreadsheet. At startup it lists the `xml/` directory, parses each invoice and extracts selected issuer, recipient, address, and shipping fields, then builds a pandas table and writes `notasfiscais.xlsx` under `xlsx/`. The graph separates those runtime stages while keeping the top-level batch script as their orchestrator. The only implementation source shown is `main.py`; input files are present in the tree, but the output directory is not.

Main entry points: [`main.py`](https://github.com/elisonrj/xml2xlsx/blob/main/main.py) (Batch conversion), [`xml`](https://github.com/elisonrj/xml2xlsx/tree/main/xml) (Invoice XML files)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_operator(("User"))
node_xml_inputs["Invoice XML files"]
node_batch["Batch conversion<br/>[main.py]"]
node_extractor["Invoice extractor<br/>[main.py]"]
node_rows["Extracted rows<br/>[main.py]"]
node_table["DataFrame assembly<br/>[main.py]"]
node_xlsx["XLSX workbook"]

node_operator -->|"runs"| node_batch
node_batch -->|"lists files"| node_xml_inputs
node_xml_inputs -->|"provides XML"| node_extractor
node_batch -->|"calls per file"| node_extractor
node_extractor -->|"appends fields"| node_rows
node_batch -->|"builds DataFrame"| node_table
node_rows -->|"provides data"| node_table
node_batch -->|"writes workbook"| node_xlsx

click node_xml_inputs "https://github.com/elisonrj/xml2xlsx/tree/main/xml"
click node_batch "https://github.com/elisonrj/xml2xlsx/blob/main/main.py"
click node_extractor "https://github.com/elisonrj/xml2xlsx/blob/main/main.py"
click node_rows "https://github.com/elisonrj/xml2xlsx/blob/main/main.py"
click node_table "https://github.com/elisonrj/xml2xlsx/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_operator toneBlue
class node_xml_inputs,node_batch,node_extractor,node_rows,node_table toneTeal
class node_xlsx toneIndigo
```

## Components

### Other components

- **User**
- [Invoice XML files](https://github.com/elisonrj/xml2xlsx/tree/main/xml): `xml`
- [Batch conversion](https://github.com/elisonrj/xml2xlsx/blob/main/main.py): `main.py`
- [Invoice extractor](https://github.com/elisonrj/xml2xlsx/blob/main/main.py): `main.py`
- [Extracted rows](https://github.com/elisonrj/xml2xlsx/blob/main/main.py): `main.py`
- [DataFrame assembly](https://github.com/elisonrj/xml2xlsx/blob/main/main.py): `main.py`
- **XLSX workbook**

## Connections

- User → Batch conversion: runs (evidence: `main.py`)
- Batch conversion → Invoice XML files: lists files (evidence: `main.py`)
- Invoice XML files → Invoice extractor: provides XML (evidence: `main.py`)
- Batch conversion → Invoice extractor: calls per file (evidence: `main.py`)
- Invoice extractor → Extracted rows: appends fields (evidence: `main.py`)
- Batch conversion → DataFrame assembly: builds DataFrame (evidence: `main.py`)
- Extracted rows → DataFrame assembly: provides data (evidence: `main.py`)
- Batch conversion → XLSX workbook: writes workbook (evidence: `main.py`)
