# avzdk/banking architecture

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

- Interactive diagram: https://gitdiagram.com/avzdk/banking
- Repository: https://github.com/avzdk/banking

## Overview

This small command-line project manually authorizes access to linked personal bank accounts, then fetches account balances and date-bounded transactions and saves each account’s results as a local JSON export. Authorization uses a browser and a user-pasted redirect URL; fetching checks the saved session and follows transaction pagination. The sampled source shows the API client, authorization, fetching, and file writes. Other capabilities, including configuration and documented date options, are represented only where the README supports them.

Main entry points: [`fetch_transactions.py`](https://github.com/avzdk/banking/blob/main/fetch_transactions.py) (Fetch command), [`authorize.py`](https://github.com/avzdk/banking/blob/main/authorize.py) (Authorize access), [`eb_client.py`](https://github.com/avzdk/banking/blob/main/eb_client.py) (JWT API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authorization["Authorization"]
  node_authorize["Authorize access<br/>[authorize.py]"]
  node_session_file["Saved session<br/>[authorize.py]"]
end

subgraph group_bank_data["Bank data retrieval"]
  node_fetch_command["Fetch command"]
  node_transaction_fetch["Transaction pagination"]
  node_balance_fetch["Balance retrieval"]
  node_json_exports["Account JSON exports"]
end

subgraph group_api["API access"]
  node_api_client["JWT API client<br/>[eb_client.py]"]
end

node_user(("Account holder"))
node_browser["Browser"]
node_enable_banking["Enable Banking API"]

node_user -->|"runs"| node_authorize
node_authorize -->|"requests authorization"| node_api_client
node_api_client -->|"sends API requests"| node_enable_banking
node_authorize -->|"opens auth link"| node_browser
node_browser -->|"provides redirect URL"| node_authorize
node_authorize -->|"writes session"| node_session_file
node_user -->|"runs with date range"| node_fetch_command
node_fetch_command -->|"reads session"| node_session_file
node_fetch_command -->|"checks session status"| node_api_client
node_fetch_command -->|"fetches per account"| node_transaction_fetch
node_transaction_fetch -->|"requests transaction pages"| node_api_client
node_fetch_command -->|"retrieves balances"| node_balance_fetch
node_balance_fetch -->|"requests balances"| node_api_client
node_fetch_command -->|"writes account results"| node_json_exports

click node_authorize "https://github.com/avzdk/banking/blob/main/authorize.py"
click node_session_file "https://github.com/avzdk/banking/blob/main/authorize.py"
click node_fetch_command "https://github.com/avzdk/banking/blob/main/fetch_transactions.py"
click node_transaction_fetch "https://github.com/avzdk/banking/blob/main/fetch_transactions.py"
click node_balance_fetch "https://github.com/avzdk/banking/blob/main/fetch_transactions.py"
click node_json_exports "https://github.com/avzdk/banking/blob/main/fetch_transactions.py"
click node_api_client "https://github.com/avzdk/banking/blob/main/eb_client.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_authorize,node_session_file,node_browser toneBlue
class node_fetch_command,node_transaction_fetch,node_balance_fetch,node_json_exports toneAmber
class node_api_client,node_enable_banking toneMint
class node_user toneIndigo
```

## Components

### Authorization

- [Authorize access](https://github.com/avzdk/banking/blob/main/authorize.py): `authorize.py`
- [Saved session](https://github.com/avzdk/banking/blob/main/authorize.py): `authorize.py`

### Bank data retrieval

- [Fetch command](https://github.com/avzdk/banking/blob/main/fetch_transactions.py): `fetch_transactions.py`
- [Transaction pagination](https://github.com/avzdk/banking/blob/main/fetch_transactions.py): `fetch_transactions.py`
- [Balance retrieval](https://github.com/avzdk/banking/blob/main/fetch_transactions.py): `fetch_transactions.py`
- [Account JSON exports](https://github.com/avzdk/banking/blob/main/fetch_transactions.py): `fetch_transactions.py`

### API access

- [JWT API client](https://github.com/avzdk/banking/blob/main/eb_client.py): `eb_client.py`

### Other components

- **Account holder**
- **Browser**
- **Enable Banking API**

## Connections

- Account holder → Authorize access: runs (evidence: `README.md`)
- Authorize access → JWT API client: requests authorization (evidence: `authorize.py`)
- JWT API client → Enable Banking API: sends API requests (evidence: `eb_client.py`)
- Authorize access → Browser: opens auth link (evidence: `authorize.py`)
- Browser → Authorize access: provides redirect URL (evidence: `authorize.py`)
- Authorize access → Saved session: writes session (evidence: `authorize.py`)
- Account holder → Fetch command: runs with date range (evidence: `README.md`)
- Fetch command → Saved session: reads session (evidence: `fetch_transactions.py`)
- Fetch command → JWT API client: checks session status (evidence: `fetch_transactions.py`)
- Fetch command → Transaction pagination: fetches per account (evidence: `fetch_transactions.py`)
- Transaction pagination → JWT API client: requests transaction pages (evidence: `fetch_transactions.py`)
- Fetch command → Balance retrieval: retrieves balances (evidence: `fetch_transactions.py`)
- Balance retrieval → JWT API client: requests balances (evidence: `fetch_transactions.py`)
- Fetch command → Account JSON exports: writes account results (evidence: `fetch_transactions.py`)
