Expand description
Bill-of-materials (BOM) generation from the parsed .pedal AST.
Walks the (already use(...)-expanded) PedalDef component list and
produces one row per refdes plus an aggregated purchase view grouped by
(category, value, model) with summed quantities.
Semantics match tools/mouser_bom.py: a diode_pair counts as 2
physical diodes (and aggregates with single diodes of the same type).
Vendor part-number mapping intentionally stays in the Python tool.
Rendering: to_table is the human-readable aligned view (per-refdes
rows followed by the aggregated view); to_csv is a machine-readable
CSV of the per-refdes rows; to_csv_aggregated is a CSV of the
aggregated lines.
Structs§
- Bom
- A complete BOM: per-refdes rows plus the aggregated purchase view.
- BomLine
- One aggregated BOM line, grouped by
(category, value, model). - BomRow
- One BOM row for a single component instance (refdes).
Functions§
- build_
bom - Build a
Bomfrom an expandedPedalDef. - to_csv
- CSV of the per-refdes rows:
refdes,category,value,model,qty. - to_
csv_ aggregated - CSV of the aggregated lines:
qty,category,value,model,refs(refs are space-separated). - to_
table - Human-readable aligned table: per-refdes rows followed by the
aggregated
(category, value, model)view.