part module#

LCSC catalogue part annotation for JLCPCB assembly.

class LCSCPart(partnumber, footprint=None, orientation=None)[source]#

Bases: object

LCSC catalogue part for a component, for JLCPCB assembly.

Attach one to a component to name the part JLCPCB should place. The exporter finds it with decompose(component, LCSCPart), so it must be a field of the component itself.

>>> class Decoupler(jitx.Component):
...     lcsc = LCSCPart("C91183")

A part library may attach it on the user’s behalf; none does today, so it is written by hand.

Parameters:
  • partnumber (str) – the LCSC C-number, such as “C91183”.

  • footprint (str | None) – package code for the BOM, when the one derived from the landpattern is wrong or cannot be determined.

  • orientation (float | None) – rotation correction in degrees, counter-clockwise, added to the placement rotation in the pick-and-place file. Use it when the part’s tape orientation differs from the landpattern’s.

partnumber: str#
footprint: str | None = None#
orientation: float | None = None#
exception AmbiguousPart[source]#

Bases: ValueError

A component carrying more than one LCSCPart.

part_of(component)[source]#

The component’s LCSCPart, if it has exactly one.

Components only. A landpattern is a shape shared by many parts and a circuit is a grouping, so a catalogue part number on either would be wrong as soon as the design is reused; decompose looks no further by design.

Raises:

AmbiguousPart – the component carries more than one.

Return type:

LCSCPart | None

Parameters:

component (Any)