# pawlisk/gmp architecture

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

- Interactive diagram: https://gitdiagram.com/pawlisk/gmp
- Repository: https://github.com/pawlisk/gmp

## Overview

GMP+ Export is a Python ETL importer: it fetches and normalizes company locations, saves location identifiers, fetches each location’s certificates, and exports results to JSON/XML and optionally SQL Server. The graph follows the documented `run()` workflow and sampled calls. XML, CSV, JSON, database, and logging capabilities are represented; some configuration and error-handling details are documented but their full runtime wiring was not sampled.

Main entry points: [`app/main.py`](https://github.com/pawlisk/gmp/blob/main/app/main.py) (Import workflow), [`app/api_client.py`](https://github.com/pawlisk/gmp/blob/main/app/api_client.py) (API client), [`main.py`](https://github.com/pawlisk/gmp/blob/main/main.py) (CLI launcher), [`app/exporter.py`](https://github.com/pawlisk/gmp/blob/main/app/exporter.py) (Location CSV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Import control"]
  node_launcher["CLI launcher<br/>[main.py]"]
  node_runner["Import workflow<br/>[main.py]"]
  node_configuration["Configuration<br/>[config.py]"]
end

subgraph group_gmp["GMP+ acquisition"]
  node_api_client["API client<br/>[api_client.py]"]
  node_gmp_api{{"GMP+ API"}}
  node_mapper["Data normalization<br/>[mappers.py]"]
end

subgraph group_outputs["Exports"]
  node_csv_export["Location CSV<br/>[exporter.py]"]
  node_json_export["Certificate JSON<br/>[exporter.py]"]
  node_xml_export["XML exports<br/>[exporter.py]"]
  node_file_output["Local output files"]
end

subgraph group_persistence["Persistence and operations"]
  node_database_access["Database access<br/>[database.py]"]
  node_sql_server[("Microsoft SQL Server")]
  node_logging["Logging setup<br/>[logger_config.py]"]
  node_log_files["Log files"]
  node_utilities["Import utilities<br/>[utils.py]"]
end

node_user(("Operator"))

node_user -->|"starts"| node_launcher
node_launcher -->|"calls"| node_runner
node_runner -->|"loads"| node_configuration
node_runner -->|"fetches locations"| node_api_client
node_runner -->|"fetches certificates"| node_api_client
node_api_client -->|"requests data"| node_gmp_api
node_api_client -->|"normalizes responses"| node_mapper
node_runner -->|"saves locations"| node_csv_export
node_runner -->|"saves certificates"| node_json_export
node_runner -->|"exports XML"| node_xml_export
node_csv_export -->|"writes CSV"| node_file_output
node_json_export -->|"writes JSON"| node_file_output
node_xml_export -->|"writes XML"| node_file_output
node_runner -->|"stores certificates"| node_database_access
node_database_access -->|"reads and writes"| node_sql_server
node_runner -->|"configures logging"| node_logging
node_logging -->|"writes logs"| node_log_files
node_runner -->|"pauses requests"| node_utilities

click node_launcher "https://github.com/pawlisk/gmp/blob/main/main.py"
click node_runner "https://github.com/pawlisk/gmp/blob/main/app/main.py"
click node_configuration "https://github.com/pawlisk/gmp/blob/main/app/config.py"
click node_api_client "https://github.com/pawlisk/gmp/blob/main/app/api_client.py"
click node_mapper "https://github.com/pawlisk/gmp/blob/main/app/mappers.py"
click node_csv_export "https://github.com/pawlisk/gmp/blob/main/app/exporter.py"
click node_json_export "https://github.com/pawlisk/gmp/blob/main/app/exporter.py"
click node_xml_export "https://github.com/pawlisk/gmp/blob/main/app/exporter.py"
click node_database_access "https://github.com/pawlisk/gmp/blob/main/app/database.py"
click node_logging "https://github.com/pawlisk/gmp/blob/main/app/logger_config.py"
click node_utilities "https://github.com/pawlisk/gmp/blob/main/app/utils.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_launcher,node_runner,node_configuration toneBlue
class node_api_client,node_gmp_api,node_mapper toneAmber
class node_csv_export,node_json_export,node_xml_export,node_file_output toneMint
class node_database_access,node_sql_server,node_logging,node_log_files,node_utilities toneRose
class node_user toneIndigo
```

## Components

### Import control

- [CLI launcher](https://github.com/pawlisk/gmp/blob/main/main.py): `main.py`
- [Import workflow](https://github.com/pawlisk/gmp/blob/main/app/main.py): `app/main.py`
- [Configuration](https://github.com/pawlisk/gmp/blob/main/app/config.py): `app/config.py`

### GMP+ acquisition

- [API client](https://github.com/pawlisk/gmp/blob/main/app/api_client.py): `app/api_client.py`
- **GMP+ API**
- [Data normalization](https://github.com/pawlisk/gmp/blob/main/app/mappers.py): `app/mappers.py`

### Exports

- [Location CSV](https://github.com/pawlisk/gmp/blob/main/app/exporter.py): `app/exporter.py`
- [Certificate JSON](https://github.com/pawlisk/gmp/blob/main/app/exporter.py): `app/exporter.py`
- [XML exports](https://github.com/pawlisk/gmp/blob/main/app/exporter.py): `app/exporter.py`
- **Local output files**

### Persistence and operations

- [Database access](https://github.com/pawlisk/gmp/blob/main/app/database.py): `app/database.py`
- **Microsoft SQL Server**
- [Logging setup](https://github.com/pawlisk/gmp/blob/main/app/logger_config.py): `app/logger_config.py`
- **Log files**
- [Import utilities](https://github.com/pawlisk/gmp/blob/main/app/utils.py): `app/utils.py`

### Other components

- **Operator**

## Connections

- Operator → CLI launcher: starts (evidence: `README.md`)
- CLI launcher → Import workflow: calls (evidence: `main.py`)
- Import workflow → Configuration: loads (evidence: `app/main.py`)
- Import workflow → API client: fetches locations (evidence: `app/main.py`)
- Import workflow → API client: fetches certificates (evidence: `app/main.py`)
- API client → GMP+ API: requests data (evidence: `app/api_client.py`)
- API client → Data normalization: normalizes responses (evidence: `app/api_client.py`)
- Import workflow → Location CSV: saves locations (evidence: `app/main.py`)
- Import workflow → Certificate JSON: saves certificates (evidence: `app/main.py`)
- Import workflow → XML exports: exports XML (evidence: `app/main.py`)
- Location CSV → Local output files: writes CSV (evidence: `app/exporter.py`)
- Certificate JSON → Local output files: writes JSON (evidence: `app/exporter.py`)
- XML exports → Local output files: writes XML (evidence: `app/exporter.py`)
- Import workflow → Database access: stores certificates (evidence: `app/main.py`)
- Database access → Microsoft SQL Server: reads and writes (evidence: `app/database.py`)
- Import workflow → Logging setup: configures logging (evidence: `app/main.py`)
- Logging setup → Log files: writes logs (evidence: `app/logger_config.py`)
- Import workflow → Import utilities: pauses requests (evidence: `app/main.py`)
