# maizeshark/evcc-to-pdf architecture

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

- Interactive diagram: https://gitdiagram.com/maizeshark/evcc-to-pdf
- Repository: https://github.com/maizeshark/evcc-to-pdf

## Overview

EVCC Charging Report Generator is a Python tool that retrieves a month of charging sessions, optionally filters and formats them, creates a localized PDF, and can email it. The primary workflow starts with a user running the script and ends with a PDF in the output folder, with email delivery optional. The sampled source shows API access, formatting, rendering, and email code; README statements support the documented filtering, localization, and template capabilities. Several internal steps are represented at the main script path because the excerpt does not expose their full implementation or call sequence.

Main entry points: [`generate_pdf_report.py`](https://github.com/maizeshark/evcc-to-pdf/blob/main/generate_pdf_report.py) (PDF rendering), [`template_en.html`](https://github.com/maizeshark/evcc-to-pdf/blob/main/template_en.html) (HTML templates), [`template_de.html`](https://github.com/maizeshark/evcc-to-pdf/blob/main/template_de.html) (German template)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and configuration"]
  node_cli["CLI and config"]
end

subgraph group_sessions["Session data"]
  node_evcc["EVCC API"]
  node_session_data["Session retrieval"]
  node_selection["Filters and columns"]
end

subgraph group_report["Report generation"]
  node_formatting["Localization and formatting"]
  node_templates["HTML templates<br/>[template_en.html]"]
  node_template_de["German template<br/>[template_de.html]"]
  node_renderer["PDF rendering"]
end

subgraph group_delivery["Delivery"]
  node_pdf["PDF report"]
  node_output["Output folder"]
  node_email["Email delivery"]
  node_smtp["SMTP service"]
end

node_user(("Report operator"))

node_user -->|"runs"| node_cli
node_cli -->|"requests data"| node_session_data
node_session_data -->|"fetches sessions"| node_evcc
node_session_data -->|"filters sessions"| node_selection
node_selection -->|"formats fields"| node_formatting
node_formatting -->|"renders with"| node_templates
node_formatting -->|"renders with"| node_template_de
node_templates -->|"provides layout"| node_renderer
node_template_de -->|"provides layout"| node_renderer
node_renderer -->|"writes PDF"| node_pdf
node_renderer -->|"saves report"| node_output
node_pdf -->|"attaches report"| node_email
node_email -->|"sends via"| node_smtp

click node_cli "https://github.com/maizeshark/evcc-to-pdf/blob/main/generate_pdf_report.py"
click node_session_data "https://github.com/maizeshark/evcc-to-pdf/blob/main/generate_pdf_report.py"
click node_selection "https://github.com/maizeshark/evcc-to-pdf/blob/main/generate_pdf_report.py"
click node_formatting "https://github.com/maizeshark/evcc-to-pdf/blob/main/generate_pdf_report.py"
click node_templates "https://github.com/maizeshark/evcc-to-pdf/blob/main/template_en.html"
click node_template_de "https://github.com/maizeshark/evcc-to-pdf/blob/main/template_de.html"
click node_renderer "https://github.com/maizeshark/evcc-to-pdf/blob/main/generate_pdf_report.py"
click node_email "https://github.com/maizeshark/evcc-to-pdf/blob/main/generate_pdf_report.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 toneBlue
class node_evcc,node_session_data,node_selection toneAmber
class node_formatting,node_templates,node_template_de,node_renderer toneMint
class node_pdf,node_output,node_email,node_smtp toneRose
class node_user toneIndigo
```

## Components

### Inputs and configuration

- [CLI and config](https://github.com/maizeshark/evcc-to-pdf/blob/main/generate_pdf_report.py): `generate_pdf_report.py`

### Session data

- **EVCC API**
- [Session retrieval](https://github.com/maizeshark/evcc-to-pdf/blob/main/generate_pdf_report.py): `generate_pdf_report.py`
- [Filters and columns](https://github.com/maizeshark/evcc-to-pdf/blob/main/generate_pdf_report.py): `generate_pdf_report.py`

### Report generation

- [Localization and formatting](https://github.com/maizeshark/evcc-to-pdf/blob/main/generate_pdf_report.py): `generate_pdf_report.py`
- [HTML templates](https://github.com/maizeshark/evcc-to-pdf/blob/main/template_en.html): `template_en.html`
- [German template](https://github.com/maizeshark/evcc-to-pdf/blob/main/template_de.html): `template_de.html`
- [PDF rendering](https://github.com/maizeshark/evcc-to-pdf/blob/main/generate_pdf_report.py): `generate_pdf_report.py`

### Delivery

- **PDF report**
- **Output folder**
- [Email delivery](https://github.com/maizeshark/evcc-to-pdf/blob/main/generate_pdf_report.py): `generate_pdf_report.py`
- **SMTP service**

### Other components

- **Report operator**

## Connections

- Report operator → CLI and config: runs (evidence: `README.md`)
- CLI and config → Session retrieval: requests data (evidence: `README.md`)
- Session retrieval → EVCC API: fetches sessions (evidence: `generate_pdf_report.py`)
- Session retrieval → Filters and columns: filters sessions (evidence: `README.md`)
- Filters and columns → Localization and formatting: formats fields (evidence: `README.md`)
- Localization and formatting → HTML templates: renders with (evidence: `README.md`)
- Localization and formatting → German template: renders with (evidence: `README.md`)
- HTML templates → PDF rendering: provides layout (evidence: `README.md`)
- German template → PDF rendering: provides layout (evidence: `README.md`)
- PDF rendering → PDF report: writes PDF (evidence: `generate_pdf_report.py`)
- PDF rendering → Output folder: saves report (evidence: `generate_pdf_report.py`)
- PDF report → Email delivery: attaches report (evidence: `README.md`)
- Email delivery → SMTP service: sends via (evidence: `generate_pdf_report.py`)
