#!/usr/bin/env python3
"""Prioritise suppliers for development and draft a 90-day development plan for each selected supplier.
CSV columns: supplier, spend (annual), score (scorecard 0-100), ppm, otd (%), risk (high/medium/low),
strategic (yes/no), single_source (yes/no), gaps (';'-separated: process control, msa, capability,
problem solving, delivery, planning, apqp/ppap, quality system, special processes, sub-tier control)
Priority index = spend share x risk factor (high 3, medium 2, low 1) x (100 - score) x 1.5 if single source.
Decision per supplier:
DEVELOP gap and (strategic, single source or high spend share): invest in a plan
REPLACE gap, not strategic, not single source, small spend: resource instead of developing
MONITOR score >= 85: scorecard only
Usage:
python dev_plan.py suppliers.csv --top 3 --start 2026-11-02
python dev_plan.py suppliers.csv --ppm-target 500 --otd-target 95
Exit codes: 0 plan printed, 2 usage or data error.
"""
import argparse
import csv
import datetime as dt
import sys
RISK = {"high": 3, "medium": 2, "low": 1}
LEVERS = {
"process control": "Control plan review on key characteristics; SPC with reaction plans; LPA at the supplier",
"msa": "Gage R&R on gauges for key characteristics; calibration system review",
"capability": "Capability studies on key characteristics; DOE or variation reduction project to reach Cpk >= 1.33",
"problem solving": "8D / 5 Why training with a coached live case; SCAR quality reviewed jointly",
"delivery": "Capacity and S&OP review; firm forecast window; safety stock; OTD daily tracking",
"planning": "Production planning and changeover (SMED) review; frozen schedule window",
"apqp/ppap": "APQP checklist and PPAP coaching for the next launch; joint gate reviews",
"quality system": "Gap analysis to ISO 9001 / IATF 16949; certification roadmap with milestones",
"special processes": "Process validation and parameter monitoring; NADCAP / CQI special process assessment",
"sub-tier control": "Sub-supplier approval, flow-down audit, incoming inspection at the supplier",
}
def yes(v):
return (v or "").strip().lower() in ("yes", "y", "true")
def main():
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
ap.add_argument("csv")
ap.add_argument("--top", type=int, default=3, help="number of suppliers to develop")
ap.add_argument("--start", type=dt.date.fromisoformat, default=dt.date.today())
ap.add_argument("--ppm-target", type=float, default=500)
ap.add_argument("--otd-target", type=float, default=95)
a = ap.parse_args()
try:
with open(a.csv, newline="", encoding="utf-8-sig") as fh:
rows = list(csv.DictReader(fh))
if not rows or not {"supplier", "spend", "score"} <= set(rows[0]):
raise ValueError("CSV needs supplier, spend and score columns (see --help)")
total = sum(float(r["spend"] or 0) for r in rows) or 1
items = []
for r in rows:
share = float(r["spend"] or 0) / total
score = float(r["score"])
idx = share * RISK.get((r.get("risk") or "medium").strip().lower(), 2) * max(0, 100 - score) * (1.5 if yes(r.get("single_source")) else 1)
if score >= 85:
decision = "MONITOR"
elif yes(r.get("strategic")) or yes(r.get("single_source")) or share >= 0.10:
decision = "DEVELOP"
else:
decision = "REPLACE"
items.append((idx, r, share, score, decision))
except (OSError, ValueError, KeyError) as e:
print(f"error: {e}", file=sys.stderr)
return 2
items.sort(key=lambda x: -x[0])
print(f"{'Supplier':<18}{'Spend %':>8}{'Score':>7}{'Risk':>8}{'Index':>8} Decision")
for idx, r, share, score, dec in items:
print(f"{r['supplier'][:17]:<18}{100 * share:>7.1f}%{score:>7.0f}{(r.get('risk') or '-'):>8}{idx:>8.2f} {dec}")
chosen = [x for x in items if x[4] == "DEVELOP"][:a.top]
for idx, r, share, score, dec in chosen:
gaps = [g.strip().lower() for g in (r.get("gaps") or "").split(";") if g.strip()]
ppm, otd = float(r.get("ppm") or 0), float(r.get("otd") or 100)
print(f"\n## Development plan: {r['supplier']} (score {score:.0f}, PPM {ppm:,.0f}, OTD {otd:.0f}%)")
tq = max(a.ppm_target, ppm / 2) if ppm > a.ppm_target else ppm
print(f"Targets at day 90: PPM <= {tq:,.0f} (then <= {a.ppm_target:g}), OTD >= {max(a.otd_target, otd):.0f}%, score >= 80")
steps = [(0, "Kick-off with supplier management: data, targets, team, commitment"),
(14, "Joint on-site assessment of the gap areas; agree root causes"),
(21, "Action plan signed by both parties: owners, dates, evidence")]
for i, g in enumerate(gaps or ["process control"]):
steps.append((30 + 15 * i, f"{g}: {LEVERS.get(g, 'define the lever with the supplier')}"))
steps += [(75, "Verify actions on site; review scorecard trend"), (90, "Close-out review: targets met -> monitor; not met -> escalate or resource")]
for day, text in sorted(steps):
print(f" {a.start + dt.timedelta(days=day)} day {day:>2} {text}")
unknown = [g for g in gaps if g not in LEVERS]
if unknown:
print(f" note: no standard lever for {', '.join(unknown)}; define it with the supplier")
replace = [r["supplier"] for _, r, *_x, dec in items if dec == "REPLACE"]
if replace:
print(f"\nResource instead of developing: {', '.join(replace)} (small spend, not strategic, not single source)")
return 0
if __name__ == "__main__":
sys.exit(main())
8d-problem-solving-report-writer
Write and review 8D problem-solving reports for customer complaints and serious nonconformities (automotive and aerospace practice: Ford Global 8D, VDA, GM, Stellantis formats): D0 emergency response, D1 cross-functional team and champion, D2 problem description with 5W2H and is / is-not and no cause in the statement, D3 interim containment within 24 hours with verification and clean point, D4 verified occurrence and escape (non-detection) root causes plus systemic cause, D5 permanent corrective actions for each cause verified before implementation, D6 implementation, validation with production data and removal of containment, D7 PFMEA, control plan and read-across to similar products, D8 closure and recognition. Checks an 8D discipline by discipline for missing content, human-error root causes, missing escape cause or action, late containment and dates out of order.
acceptance-sampling-plan-selector
Select and evaluate acceptance sampling plans for incoming, in-process and final inspection: ANSI/ASQ Z1.4 / ISO 2859-1 single sampling under normal inspection (code letter from lot size and inspection level I, II, III, S-1 to S-4; sample size, Ac and Re from AQL, following the table's arrows to the correct plan; 100% when n reaches the lot size; AQLs above 10 per 100 units), operating characteristic curves (Pa at any quality, producer's quality level, indifference point, LTPD, AOQ and AOQL, binomial or hypergeometric), plans designed from producer and consumer risk, and c = 0 zero-acceptance plans. Covers AQL choice by defect class, switching rules between normal, tightened and reduced inspection, when sampling is not appropriate, and random sampling.
approved-supplier-list-manager
Manage and audit an approved supplier list (ASL) / external provider register for ISO 9001 8.4.1, IATF 16949 8.4 and AS9100 8.4.1: supplier status (approved, conditional, probation, pending, disqualified), scope of approval by commodity and process, risk class, certification and expiry, re-evaluation intervals by risk, conditions with end dates, single-source contingency, approver and customer-directed sources. Audits the list for expired or expiring certificates, overdue re-evaluations, conditional or probation status past its decision date, high-risk suppliers without the required certification, single-source suppliers without backup and missing approvers, and checks purchase orders for suppliers that are off-list, disqualified or pending, or buying outside the approved scope. Covers ERP blocks, PO requirements, off-list and emergency purchases.
apqp-phase-planner
Plan and track Advanced Product Quality Planning (AIAG APQP 3rd edition, IATF 16949) for a new or changed automotive part: back-schedule the five phases (plan and define, product design, process design, product and process validation, launch and feedback) from the start-of-production date by program complexity, with overlap, PPAP lead and safe-launch period; list the deliverables and gate for each phase (DFMEA, DVP&R, feasibility, process flow, PFMEA, control plans, MSA, Ppk, run at rate, PPAP, safe launch, lessons learned); adjust for build-to-print suppliers; flag compressed timelines and late or untracked deliverables against a status list. Covers gate reviews, red/yellow/green status reporting, run at rate and safe-launch exit criteria.
as9100-gap-analyzer
Run an AS9100D / EN 9100:2018 gap analysis for aviation, space and defence suppliers on the requirements added to ISO 9001: on-time delivery and conformity focus, management representative, ethics and human-factors awareness, operational planning and operational risk management, configuration management, product safety, counterfeit-part prevention, special requirements, critical items and key characteristics, external provider register and flow-down, FOD prevention, tooling and NC program control, special process validation, first article inspection (AS9102), traceability, in-service data and nonconforming product control. Generates and scores a worksheet, grades missing core controls as major, and checks invalid n/a claims. Covers AS9101/AS9104, OASIS, AS9102 FAI forms, counterfeit standards (AS5553, AS6174, AS6081), NADCAP and the planned IA9100 transition.
audit-report-writer
Write internal, supplier and pre-certification audit reports with the content ISO 19011:2018 6.5 expects: audit objectives, scope, criteria with revisions, dates, team and auditees, method and sampling statement, specific strengths, findings table and three-part finding details (requirement, evidence, statement), conclusion on the degree of fulfilment of criteria, diverging opinions, follow-up deadlines and distribution. Builds a Markdown report from a JSON audit record, generates the conclusion from the findings (major / minor / none) and flags reports missing required content or findings without clause or evidence. Covers conclusion wording, closing meetings, response expectations and verifying corrective actions.