# lek-glitch/vendor-risk-scorer architecture

> Architecture diagram of the GitHub repository lek-glitch/vendor-risk-scorer, 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/lek-glitch/vendor-risk-scorer
- Repository: https://github.com/lek-glitch/vendor-risk-scorer

## Overview

This is a small command-line vendor risk scoring tool. The workflow reads questionnaire rows from CSV, validates required controls, calculates weighted scores and risk tiers, then prints a ranked report and optionally exports CSV. Scoring and tiering are distinct domain stages within the same source file. The sample vendor CSV is example input, not a runtime subsystem. The source excerpt supports the shown calls; no separate services or persistent store are present.

Main entry points: [`vendor_risk_scorer.py`](https://github.com/lek-glitch/vendor-risk-scorer/blob/main/vendor_risk_scorer.py) (CLI entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflow"]
  node_cli_entry["CLI entry"]
  node_csv_processing["CSV processing"]
end

subgraph group_assessment["Risk assessment"]
  node_score["Weighted scoring"]
  node_tier["Risk tiering"]
end

subgraph group_reporting["Reports"]
  node_print_report["Console report"]
  node_csv_export["CSV export"]
end

node_user(("Operator"))
node_csv_input["Questionnaire CSV"]
node_csv_output["Risk report CSV"]

node_user -->|"runs"| node_cli_entry
node_cli_entry -->|"processes"| node_csv_processing
node_csv_input -->|"supplies rows"| node_csv_processing
node_csv_processing -->|"scores rows"| node_score
node_csv_processing -->|"assigns tier"| node_tier
node_cli_entry -->|"prints results"| node_print_report
node_cli_entry -->|"exports optionally"| node_csv_export
node_csv_export -->|"writes"| node_csv_output

click node_cli_entry "https://github.com/lek-glitch/vendor-risk-scorer/blob/main/vendor_risk_scorer.py"
click node_csv_processing "https://github.com/lek-glitch/vendor-risk-scorer/blob/main/vendor_risk_scorer.py"
click node_score "https://github.com/lek-glitch/vendor-risk-scorer/blob/main/vendor_risk_scorer.py"
click node_tier "https://github.com/lek-glitch/vendor-risk-scorer/blob/main/vendor_risk_scorer.py"
click node_print_report "https://github.com/lek-glitch/vendor-risk-scorer/blob/main/vendor_risk_scorer.py"
click node_csv_export "https://github.com/lek-glitch/vendor-risk-scorer/blob/main/vendor_risk_scorer.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_entry,node_csv_processing toneBlue
class node_score,node_tier toneAmber
class node_print_report,node_csv_export toneMint
class node_user,node_csv_input,node_csv_output toneIndigo
```

## Components

### CLI workflow

- [CLI entry](https://github.com/lek-glitch/vendor-risk-scorer/blob/main/vendor_risk_scorer.py): `vendor_risk_scorer.py`
- [CSV processing](https://github.com/lek-glitch/vendor-risk-scorer/blob/main/vendor_risk_scorer.py): `vendor_risk_scorer.py`

### Risk assessment

- [Weighted scoring](https://github.com/lek-glitch/vendor-risk-scorer/blob/main/vendor_risk_scorer.py): `vendor_risk_scorer.py`
- [Risk tiering](https://github.com/lek-glitch/vendor-risk-scorer/blob/main/vendor_risk_scorer.py): `vendor_risk_scorer.py`

### Reports

- [Console report](https://github.com/lek-glitch/vendor-risk-scorer/blob/main/vendor_risk_scorer.py): `vendor_risk_scorer.py`
- [CSV export](https://github.com/lek-glitch/vendor-risk-scorer/blob/main/vendor_risk_scorer.py): `vendor_risk_scorer.py`

### Other components

- **Operator**
- **Questionnaire CSV**
- **Risk report CSV**

## Connections

- Operator → CLI entry: runs (evidence: `README.md`)
- CLI entry → CSV processing: processes (evidence: `vendor_risk_scorer.py`)
- Questionnaire CSV → CSV processing: supplies rows (evidence: `vendor_risk_scorer.py`)
- CSV processing → Weighted scoring: scores rows (evidence: `vendor_risk_scorer.py`)
- CSV processing → Risk tiering: assigns tier (evidence: `vendor_risk_scorer.py`)
- CLI entry → Console report: prints results (evidence: `vendor_risk_scorer.py`)
- CLI entry → CSV export: exports optionally (evidence: `vendor_risk_scorer.py`)
- CSV export → Risk report CSV: writes (evidence: `vendor_risk_scorer.py`)
