bom module#

The bill of materials JLCPCB’s assembly matcher reads.

MAX_DESIGNATORS = 200#

JLCPCB caps one BOM line at 200 reference designators.

class Line(comment, designators, footprint, lcsc)[source]#

Bases: object

One BOM row: a group of interchangeable parts.

Parameters:
comment: str#
designators: list[str]#
footprint: str#
lcsc: str | None#
row()[source]#
Return type:

tuple[str, str, str, int, str]

write(path, parts)[source]#

Write the BOM and return the lines written.

Return type:

list[Line]

Parameters:
group(parts)[source]#

Collect parts into BOM lines, splitting at the designator cap.

The key carries the designator prefix because JLCPCB rejects a row holding more than one component type, which they determine by prefix: without it a jumper and a resistor sharing a 0 ohm part number would merge.

Return type:

list[Line]

Parameters:

parts (list[Part])

check_designators(parts)[source]#

Refuse designators that collide once JLCPCB uppercases them.

Their BOM page says every letter is capitalised for production, so r1 and R1 are one part there however distinct they are in the design.

Return type:

None

Parameters:

parts (list[Part])

prefix(designator)[source]#

The alphabetic head of a designator: R for R12.

Return type:

str

Parameters:

designator (str)

natural(designator)[source]#

Sort key placing C2 before C10.

Return type:

tuple[object, ...]

Parameters:

designator (str)