#!/usr/bin/env python3 """ Process Flow HTML Generator ============================ Generates standalone HTML process flow diagrams. The template is embedded directly in the script - no network access required at runtime. Fetch: https://audittoolbox.com/apps/processflow-generate.py.txt Usage: python processflow-generate.py '{"nodes":[...],"edges":[...]}' # Or pipe JSON: echo '{"nodes":[...],"edges":[...]}' | python processflow-generate.py # Or with a file: python processflow-generate.py < data.json > output.html Output is a standalone HTML file that renders the process flow diagram. JSON Schema: { "nodes": [ { "id": "string", // Unique identifier "title": "string", // Display title "description": "string", // Optional description "x": number, // Optional x position (auto-layout if missing) "y": number, // Optional y position (auto-layout if missing) "risks": [ // Optional array of risks { "id": "string", "name": "string", "controls": [ // Optional array of controls {"id": "string", "name": "string"} ] } ] } ], "edges": [ { "id": "string", // Unique identifier "source": "string", // Source node id "target": "string", // Target node id "label": "string" // Optional edge label } ] } """ import sys import json # Embedded HTML template - the placeholder "__PROCESS_FLOW_JSON__" will be replaced TEMPLATE = r'''
| Step | Risks | Controls |
|---|