# jhon287/bnppf architecture

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

- Interactive diagram: https://gitdiagram.com/jhon287/bnppf
- Repository: https://github.com/jhon287/bnppf

## Overview

BNPPF is a batch importer for Easy Banking CSV statements: it detects each file’s CSV version, parses and classifies transaction rows, writes valid transactions to MariaDB/MySQL, and moves processed files to done or error directories. The README also mentions displaying information on a web page, but no web-page implementation appears in the supplied tree. The main and parser excerpts support the shown calls; SQL procedure details and any display subsystem were not sampled.

Main entry points: [`src/app/main.py`](https://github.com/jhon287/bnppf/blob/main/src/app/main.py) (Batch importer), [`src/app/bnppf.py`](https://github.com/jhon287/bnppf/blob/main/src/app/bnppf.py) (Transaction parser), [`sql/00_procedures.sql`](https://github.com/jhon287/bnppf/blob/main/sql/00_procedures.sql) (Add transaction procedure), [`sql/00_schema.sql`](https://github.com/jhon287/bnppf/blob/main/sql/00_schema.sql) (Transaction schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["CSV ingestion"]
  node_todo["Pending CSVs"]
  node_batch["Batch importer<br/>[main.py]"]
  node_done["Completed CSVs"]
  node_errors["Failed CSVs"]
end

subgraph group_processing["Transaction processing"]
  node_version["Version detection<br/>[bnppf.py]"]
  node_parser["Transaction parser<br/>[bnppf.py]"]
  node_classifier["Type classification<br/>[bnppf.py]"]
end

subgraph group_persistence["Database persistence"]
  node_mysql[("MariaDB / MySQL")]
  node_procedure[("Add transaction procedure<br/>[00_procedures.sql]")]
  node_schema[("Transaction schema<br/>[00_schema.sql]")]
end

node_operator(("CSV operator"))
node_web["Information web page"]

node_operator -->|"provides CSVs"| node_todo
node_batch -->|"reads files"| node_todo
node_batch -->|"detects version"| node_version
node_batch -->|"parses rows"| node_parser
node_parser -->|"classifies type"| node_classifier
node_batch -->|"connects"| node_mysql
node_batch -.->|"calls"| node_procedure
node_procedure -.->|"uses schema"| node_schema
node_batch -->|"moves successful files"| node_done
node_batch -->|"moves failed files"| node_errors
node_mysql -.->|"provides information"| node_web

click node_batch "https://github.com/jhon287/bnppf/blob/main/src/app/main.py"
click node_version "https://github.com/jhon287/bnppf/blob/main/src/app/bnppf.py"
click node_parser "https://github.com/jhon287/bnppf/blob/main/src/app/bnppf.py"
click node_classifier "https://github.com/jhon287/bnppf/blob/main/src/app/bnppf.py"
click node_procedure "https://github.com/jhon287/bnppf/blob/main/sql/00_procedures.sql"
click node_schema "https://github.com/jhon287/bnppf/blob/main/sql/00_schema.sql"

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_todo,node_batch,node_done,node_errors toneBlue
class node_version,node_parser,node_classifier toneAmber
class node_mysql,node_procedure,node_schema toneMint
class node_operator,node_web toneIndigo
```

## Components

### CSV ingestion

- **Pending CSVs**
- [Batch importer](https://github.com/jhon287/bnppf/blob/main/src/app/main.py): `src/app/main.py`
- **Completed CSVs**
- **Failed CSVs**

### Transaction processing

- [Version detection](https://github.com/jhon287/bnppf/blob/main/src/app/bnppf.py): `src/app/bnppf.py`
- [Transaction parser](https://github.com/jhon287/bnppf/blob/main/src/app/bnppf.py): `src/app/bnppf.py`
- [Type classification](https://github.com/jhon287/bnppf/blob/main/src/app/bnppf.py): `src/app/bnppf.py`

### Database persistence

- **MariaDB / MySQL**
- [Add transaction procedure](https://github.com/jhon287/bnppf/blob/main/sql/00_procedures.sql): `sql/00_procedures.sql`
- [Transaction schema](https://github.com/jhon287/bnppf/blob/main/sql/00_schema.sql): `sql/00_schema.sql`

### Other components

- **CSV operator**
- **Information web page**

## Connections

- CSV operator → Pending CSVs: provides CSVs (evidence: `README.md`)
- Batch importer → Pending CSVs: reads files (evidence: `src/app/main.py`)
- Batch importer → Version detection: detects version (evidence: `src/app/main.py`)
- Batch importer → Transaction parser: parses rows (evidence: `src/app/main.py`)
- Transaction parser → Type classification: classifies type (evidence: `src/app/bnppf.py`)
- Batch importer → MariaDB / MySQL: connects (evidence: `src/app/main.py`)
- Batch importer → Add transaction procedure: calls
- Add transaction procedure → Transaction schema: uses schema
- Batch importer → Completed CSVs: moves successful files (evidence: `src/app/main.py`)
- Batch importer → Failed CSVs: moves failed files (evidence: `src/app/main.py`)
- MariaDB / MySQL → Information web page: provides information (evidence: `README.md`)
