Skip to main content

Module bom

Module bom 

Source
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 Bom from an expanded PedalDef.
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.