On This Page (18)
PCB & Footprints
KiCadPcb, KiCadFootprint, pads, tracks, vias, zones, layer flash resolution, and board projection.
18 public symbols.
Footprint
classfrom kicad_monkey import Footprint
class Footprint(library_link: 'str', layer: 'str' = 'F.Cu', at_x: 'float' = 0.0, at_y: 'float' = 0.0, at_angle: 'float' = 0.0, locked: 'bool' = False, placement: 'FootprintPlacement' = <factory>, uuid: 'Optional[str]' = None, descr: 'Optional[str]' = None, tags: 'Optional[str]' = None, attr: 'List[str]' = <factory>, component_classes: 'List[ComponentClassRef]' = <factory>, properties: 'List[Property]' = <factory>, pads: 'List[Pad]' = <factory>, fp_lines: 'List[FpLine]' = <factory>, fp_arcs: 'List[FpArc]' = <factory>, fp_circles: 'List[FpCircle]' = <factory>, fp_rects: 'List[FpRect]' = <factory>, fp_polys: 'List[FpPoly]' = <factory>, fp_texts: 'List[FpText]' = <factory>, fp_text_boxes: 'List[FpTextBox]' = <factory>, images: 'List[Image]' = <factory>, tables: 'List[Table]' = <factory>, barcodes: 'List[Barcode]' = <factory>, dimensions: 'List[Dimension]' = <factory>, zones: 'List[Zone]' = <factory>, groups: 'List[Group]' = <factory>, variants: 'List[FootprintVariant]' = <factory>, models: 'List[Model]' = <factory>, embedded_fonts: 'bool' = False, embedded_files: 'List[EmbeddedFile]' = <factory>, net_tie_pad_groups: 'List[PadNameGroup]' = <factory>, duplicate_pad_numbers_are_jumpers: 'Optional[bool]' = None, jumper_pad_groups: 'List[PadNameGroup]' = <factory>, solder_mask_margin: 'Optional[float]' = None, solder_paste_margin: 'Optional[float]' = None, solder_paste_margin_ratio: 'Optional[float]' = None, clearance: 'Optional[float]' = None, zone_connect: 'Optional[int]' = None, unknown_elements: 'List[UnknownElement]' = <factory>, _raw_sexp: 'Optional[list]' = None, *, _has_embedded_files: 'bool' = False, _embedded_files_unknown: 'List[Any]' = <factory>, _unknown_atoms: 'List[Any]' = <factory>) -> 'None'
Footprint (component) element embedded in a PCB.
Members (25)
| Member | Kind | Signature | Summary |
|---|---|---|---|
add_object | method | (self, obj: 'object') -> 'object' | Add a typed object to the matching embedded-footprint-owned list. |
from_sexp | classmethod | (cls, sexp: 'list') -> "'Footprint'" | |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box of this footprint in board coordinates.. |
get_property | method | (self, name: 'str') -> 'str | None' | Get a footprint property value by name. |
get_property_object | method | (self, name: 'str') -> 'Property | None' | Get a footprint property object by name. |
get_property_value | method | (self, name: 'str', default: 'str' = '') -> 'str' | Get a footprint property value, returning default when absent. |
is_dnp | property | -> 'bool' | |
is_excluded_from_bom | property | -> 'bool' | |
is_excluded_from_pos_files | property | -> 'bool' | |
iter_objects | method | (self) -> 'Iterator[object]' | Iterate over embedded-footprint-owned objects. |
iter_properties | method | (self) -> 'Iterator[Property]' | Iterate over footprint properties. |
objects | property | -> "'KiCadObjectCollection'" | Live read-only query view over embedded-footprint-owned objects. |
outline_items | method | (self, layer_name: 'str' = 'Edge.Cuts') -> 'list[object]' | Return footprint-local items that can act as board-outline carriers. |
path | property | -> 'str' | |
remove_object | method | (self, obj: 'object') -> 'bool' | Remove an object by identity from its owning footprint list. |
remove_property | method | (self, name: 'str') -> 'bool' | Remove a footprint property by name. |
remove_variant_override | method | (self, name: 'str') -> 'bool' | Drop the variant override named ``name``. Returns ``True`` if |
set_property_value | method | (self, name: 'str', value: 'str', *, create: 'bool' = False) -> 'bool' | Set a footprint property value. Returns True if updated or created. |
set_variant_override | method | (self, name: 'str', *, dnp: 'Optional[bool]' = None, exclude_from_bom: 'Optional[bool]' = None, exclude_from_pos_files: 'Optional[bool]' = None, fields: "'Optional[dict[str, str]]'" = None, replace_fields: 'bool' = False) -> 'FootprintVariant' | Add or update a per-footprint variant override. |
sheetfile | property | -> 'str' | |
sheetname | property | -> 'str' | |
to_ir | method | (self, *, document_id: 'str | None' = None, board: "'KiCadPcb | None'" = None) -> "'KiCadPlotterDocument'" | Render this PCB-embedded footprint to a single-record plotter IR document. |
to_sexp | method | (self) -> 'list' | |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None) -> 'List[str]' | Render this footprint to SVG elements.. |
upsert_property | method | (self, name: 'str', value: 'str') -> 'Property' | Create or update a footprint property and return the property object. |
FpLine
classfrom kicad_monkey import FpLine
class FpLine(start_x: 'float', start_y: 'float', end_x: 'float', end_y: 'float', layer: 'str' = 'F.SilkS', stroke: 'Stroke' = <factory>, uuid: 'Optional[str]' = None, _raw_sexp: 'Optional[list]' = None, *, _has_empty_uuid: 'bool' = False, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Footprint line element.
Members (4)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list') -> "'FpLine'" | |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box of this line.. |
to_sexp | method | (self) -> 'list' | |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None) -> 'List[str]' | Render this line to SVG elements.. |
FpText
classfrom kicad_monkey import FpText
class FpText(text_type: 'str', text: 'str', at_x: 'float', at_y: 'float', at_angle: 'float' = 0.0, layer: 'str' = 'F.SilkS', knockout: 'bool' = False, hide: 'bool' = False, unlocked: 'bool' = False, uuid: 'Optional[str]' = None, effects: 'Effects' = <factory>, render_cache: 'Optional[RenderCache]' = None, render_cache_error: 'Optional[str]' = None, _raw_sexp: 'Optional[list]' = None, *, _hide_style: 'Optional[str]' = None, _hide_on_self: 'bool' = False, _hide_explicit_no: 'bool' = False, _has_empty_uuid: 'bool' = False, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Footprint text element.
Members (8)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list') -> "'FpText'" | |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box of this text element.. |
h_align | property | -> 'str' | Get horizontal alignment. |
is_mirrored | property | -> 'bool' | Check if text is mirrored. |
to_sexp | method | (self) -> 'list' | |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None) -> 'List[str]' | Render this text element to SVG.. |
to_text_params | method | (self, footprint: "'Optional[KiCadFootprint]'" = None) -> "'TextParams'" | Convert footprint-local text to `TextParams` for outline rendering. |
v_align | property | -> 'str' | Get vertical alignment. |
FpTextBox
classfrom kicad_monkey import FpTextBox
class FpTextBox(text: 'str' = '', start_x: 'float' = 0.0, start_y: 'float' = 0.0, end_x: 'float' = 0.0, end_y: 'float' = 0.0, margins: 'Tuple[float, float, float, float]' = (0.0, 0.0, 0.0, 0.0), angle: 'float' = 0.0, polygon_points: 'Optional[list[Tuple[float, float]]]' = None, layer: 'str' = 'F.SilkS', locked: 'bool' = False, effects: 'Optional[Effects]' = None, stroke: 'Optional[Stroke]' = None, border: 'Optional[bool]' = None, knockout: 'Optional[bool]' = None, render_cache: 'Optional[RenderCache]' = None, uuid: 'Optional[str]' = None, _raw_sexp: 'Optional[list]' = None, *, _has_empty_uuid: 'bool' = False, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Footprint-local text box element.
Members (6)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list') -> "'FpTextBox'" | |
get_bounds | method | (self) -> "'BoundingBox'" | |
render_cache_text | method | (self, text: 'Optional[str]' = None, footprint: "'Optional[KiCadFootprint]'" = None) -> 'str' | Return resolved footprint text-box text after KiCad wrapping. |
to_sexp | method | (self) -> 'list' | |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None) -> 'list[str]' | |
to_text_params | method | (self, text: 'Optional[str]' = None, footprint: "'Optional[KiCadFootprint]'" = None) -> "'TextParams'" | Convert footprint text-box content to `TextParams` for outline rendering. |
GrLine
classfrom kicad_monkey import GrLine
class GrLine(start_x: 'float', start_y: 'float', end_x: 'float', end_y: 'float', angle: 'float' = 0.0, layer: 'str' = 'Edge.Cuts', stroke: 'Stroke' = <factory>, uuid: 'Optional[str]' = None, _raw_sexp: 'Optional[list]' = None, *, locked: 'bool' = False, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Graphical line element (gr_line).
A line segment defined by start and end points with a stroke width.
The polygon representation is a capsule (stadium) shape.
Members (6)
| Member | Kind | Signature | Summary |
|---|---|---|---|
end | property | -> 'tuple[float, float]' | Get end point as tuple. |
from_sexp | classmethod | (cls, sexp: 'list') -> "'GrLine'" | Parse from s-expression. |
get_bounds | method | (self) -> "'BoundingBox'" | Return KiCad-style source geometry bounds. |
start | property | -> 'tuple[float, float]' | Get start point as tuple. |
to_sexp | method | (self) -> 'list' | Serialize to s-expression. |
width | property | -> 'float' | Get stroke width. |
GrText
classfrom kicad_monkey import GrText
class GrText(text: 'str', at_x: 'float', at_y: 'float', at_angle: 'float' = 0.0, layer: 'str' = 'F.SilkS', knockout: 'bool' = False, uuid: 'Optional[str]' = None, effects: 'Effects' = <factory>, render_cache: 'Optional[RenderCache]' = None, _raw_sexp: 'Optional[list]' = None, _renderer: "Optional['KiCadTextRenderer']" = None, *, locked: 'bool' = False, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Graphical text element (gr_text).
Supports full KiCad text rendering including:
- Custom fonts (via font face name)
- Bold, italic, mirrored text
- Knockout text (text with background cutout)
- Pre-computed render_cache for complex fonts
Polygon conversion uses the kicad_text.py renderer for accurate results.
Members (12)
| Member | Kind | Signature | Summary |
|---|---|---|---|
font | property | -> 'Font' | Get font from effects. |
from_sexp | classmethod | (cls, sexp: 'list') -> "'GrText'" | Parse from s-expression. |
get_knockout_margin | method | (self) -> 'float' | Calculate knockout text margin using KiCad's formula. |
h_align | property | -> 'str' | Get horizontal alignment. |
is_bold | property | -> 'bool' | Check if text is bold. |
is_italic | property | -> 'bool' | Check if text is italic. |
is_mirrored | property | -> 'bool' | Check if text is mirrored (from justify). |
position | property | -> 'Tuple[float, float]' | Get text position as tuple. |
render | method | (self) -> "'RenderedGeometry'" | Render text to RenderedGeometry using the KiCad text renderer. |
to_sexp | method | (self) -> 'list' | Serialize to s-expression. |
to_text_params | method | (self) -> "'TextParams'" | Convert to TextParams for use with KiCadTextRenderer. |
v_align | property | -> 'str' | Get vertical alignment. |
GrTextBox
classfrom kicad_monkey import GrTextBox
class GrTextBox(text: 'str' = '', start_x: 'float' = 0.0, start_y: 'float' = 0.0, end_x: 'float' = 0.0, end_y: 'float' = 0.0, margins: 'Tuple[float, float, float, float]' = (0.0, 0.0, 0.0, 0.0), angle: 'float' = 0.0, polygon_points: 'Optional[List[Tuple[float, float]]]' = None, layer: 'str' = 'F.SilkS', locked: 'bool' = False, effects: 'Optional[Effects]' = None, stroke: 'Optional[Stroke]' = None, border: 'Optional[bool]' = None, knockout: 'Optional[bool]' = None, render_cache: 'Optional[RenderCache]' = None, uuid: 'Optional[str]' = None, _raw_sexp: 'Optional[list]' = None, *, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Graphical text box element (gr_text_box).
Members (10)
| Member | Kind | Signature | Summary |
|---|---|---|---|
font | property | -> 'Font' | Return text-box font parameters, with KiCad defaults if absent. |
from_sexp | classmethod | (cls, sexp: 'list') -> "'GrTextBox'" | |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box of this text box.. |
h_align | property | -> 'str' | |
is_mirrored | property | -> 'bool' | |
render_cache_text | method | (self, text: 'Optional[str]' = None) -> 'str' | Return resolved text after KiCad text-box wrapping. |
to_sexp | method | (self) -> 'list' | |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None) -> 'List[str]' | Render this text box to SVG elements.. |
to_text_params | method | (self, text: 'Optional[str]' = None) -> "'TextParams'" | Convert board text-box content to `TextParams` for outline rendering. |
v_align | property | -> 'str' |
KiCadFootprint
classfrom kicad_monkey import KiCadFootprint
class KiCadFootprint(path: 'Union[str, Path, None]' = None) -> 'None'
Standalone KiCad footprint file (.kicad_mod).
Supports full round-trip: file -> object -> file with 100% fidelity.
Example:
>>> fp = KiCadFootprint("R0603.kicad_mod")
>>> fp.name
'R0603'
>>> len(fp.pads)
2
>>> fp.save("output.kicad_mod")
Members (23)
| Member | Kind | Signature | Summary |
|---|---|---|---|
add_object | method | (self, obj: 'object') -> 'object' | Add a typed object to the matching footprint-owned list. |
from_file | classmethod | (cls, path: 'Union[str, Path]') -> "'KiCadFootprint'" | Load a KiCad footprint file. Deprecated: use ``KiCadFootprint(path)``. |
from_sexp | classmethod | (cls, sexp: 'list') -> "'KiCadFootprint'" | Parse from s-expression list. |
from_string | classmethod | (cls, content: 'str') -> "'KiCadFootprint'" | Parse KiCad footprint content from string. |
get_bounds | method | (self) -> "'BoundingBox'" | Compute the bounding box of the entire footprint. |
get_property | method | (self, name: 'str') -> 'str | None' | Get a footprint property value by name. |
get_property_object | method | (self, name: 'str') -> 'Property | None' | Get a footprint property object by name. |
get_property_value | method | (self, name: 'str', default: 'str' = '') -> 'str' | Get a footprint property value, returning default when absent. |
iter_objects | method | (self) -> 'Iterator[object]' | Iterate over footprint-owned objects. |
iter_properties | method | (self) -> 'Iterator[Property]' | Iterate over footprint properties. |
objects | property | -> "'KiCadObjectCollection'" | Live read-only query view over footprint-owned objects. |
reference | property | -> 'Optional[str]' | Get the Reference property value. |
remove_object | method | (self, obj: 'object') -> 'bool' | Remove an object by identity from its owning footprint list. |
remove_property | method | (self, name: 'str') -> 'bool' | Remove a footprint property by name. |
save | method | (self, path: 'Union[str, Path]') -> 'None' | Save to a KiCad footprint file. Canonical save method per ADR-0043. |
set_property_value | method | (self, name: 'str', value: 'str', *, create: 'bool' = False) -> 'bool' | Set a footprint property value. Returns True if updated or created. |
to_file | method | (self, path: 'Union[str, Path]') -> 'None' | Deprecated: use ``save()``. |
to_ir | method | (self, *, source_path: 'str | None' = None, document_id: 'str | None' = None) -> "'KiCadPlotterDocument'" | Render this footprint to plotter IR. |
to_sexp | method | (self) -> 'list' | Convert to s-expression list. |
to_string | method | (self) -> 'str' | Serialize to KiCad footprint format string. |
to_svg | method | (self, layers: 'Optional[List[str]]' = None, fill: 'str' = '#000000', stroke: 'str' = '#000000', black_and_white: 'bool' = True, profile: 'str | None' = None, options: "Optional['KiCadSvgRenderOptions']" = None) -> 'str' | Render footprint to SVG format matching KiCad's output. |
upsert_property | method | (self, name: 'str', value: 'str') -> 'Property' | Create or update a footprint property and return the property object. |
value | property | -> 'Optional[str]' | Get the Value property value. |
KiCadPcb
classfrom kicad_monkey import KiCadPcb
class KiCadPcb(path: 'Union[str, Path, None]' = None) -> 'None'
Complete KiCad PCB file representation.
Supports full round-trip: file -> object -> file with 100% fidelity.
Example:
>>> pcb = KiCadPcb("board.kicad_pcb")
>>> pcb.footprints[0].reference
>>> pcb.save("output.kicad_pcb")
Members (35)
| Member | Kind | Signature | Summary |
|---|---|---|---|
add_object | method | (self, obj: 'object') -> 'object' | Add a typed object to the matching board-owned list. |
aux_axis_origin_mm | property | -> 'tuple[float, float]' | Return the KiCad ``setup/aux_axis_origin`` in millimeters. |
bake_virtual_layers | method | (self, options: 'Any' = None, *, variant: 'Optional[str]' = None) -> 'Any' | Bake selected virtual fab layers into KiCad ``User.*`` layers in place. |
board_outline_carriers | method | (self, *, include_top_level: 'bool' = True, include_footprint_local: 'bool' = True, layer_name: 'str' = 'Edge.Cuts') -> 'List[OutlineCarrier]' | Return all currently recognized board-outline carrier items. |
fab | method | (self, *, variant: 'Optional[str]' = None, stem: 'Optional[str]' = None) -> 'Any' | Build an analytic :class:`kicad_monkey.fab.Fab` facade for this PCB. |
footprint_outline_items | method | (self, layer_name: 'str' = 'Edge.Cuts') -> 'List[OutlineCarrier]' | Return footprint-local outline carriers promoted to board-level meaning. |
from_file | classmethod | (cls, path: 'Union[str, Path]') -> "'KiCadPcb'" | Load a KiCad PCB file. Deprecated: use ``KiCadPcb(path)``. |
from_sexp | classmethod | (cls, sexp: 'list') -> "'KiCadPcb'" | Parse from s-expression list. |
from_string | classmethod | (cls, content: 'str') -> "'KiCadPcb'" | Parse KiCad PCB content from string. |
get_bounds | method | (self, layers: 'Optional[List[str]]' = None) -> "'BoundingBox'" | Get bounding box of this PCB.. |
get_property | method | (self, key: 'str') -> 'str | None' | Get a board property value by key. |
get_property_object | method | (self, key: 'str') -> 'BoardProperty | None' | Get a board property object by key. |
get_property_value | method | (self, key: 'str', default: 'str' = '') -> 'str' | Get a board property value, returning default when absent. |
grid_origin_mm | property | -> 'tuple[float, float] | None' | Read authored setup/grid_origin, preserving absence and zero. |
iter_objects | method | (self) -> 'Iterator[object]' | Iterate over top-level board-owned objects. |
iter_properties | method | (self) -> 'Iterator[BoardProperty]' | Iterate over board properties. |
net_name_by_ordinal | method | (self) -> 'dict[int, str]' | Return the board net-name table keyed by ordinal. |
net_table | method | (self) -> 'NetTable' | Build an immutable net-table snapshot for repeated resolution. |
new | classmethod | (cls, *, paper: 'str' = 'A4') -> "'KiCadPcb'" | Create a blank, openable board with KiCad's default 2-layer stack. |
objects | property | -> "'KiCadObjectCollection'" | Live read-only query view over board-owned objects. |
remove_object | method | (self, obj: 'object') -> 'bool' | Remove an object by identity from its owning board list. |
remove_property | method | (self, key: 'str') -> 'bool' | Remove a board property by key. |
resolve_net_name | method | (self, net_ref: 'NetRef | None') -> 'str' | Resolve a board-element net name from a NetRef. |
resolve_net_ref | method | (self, net_ref: 'NetRef | None') -> 'NetRef' | Resolve a board-element net reference against the PCB net table when possible. |
save | method | (self, path: 'Union[str, Path]') -> 'None' | Save to a KiCad PCB file. Canonical save method per ADR-0043. |
set_property_value | method | (self, key: 'str', value: 'str', *, create: 'bool' = False) -> 'bool' | Set a board property value. Returns True if updated or created. |
source_inventory | method | (self, detail: 'str' = 'summary') -> 'dict' | Return a ``kicad.pcb.source_inventory`` dict describing parser coverage. |
to_file | method | (self, path: 'Union[str, Path]') -> 'None' | Deprecated: use ``save()``. |
to_ir | method | (self, *, source_path: 'str | None' = None, document_id: 'str | None' = None) -> "'KiCadPlotterDocument'" | Render this board to plotter IR. |
to_sexp | method | (self) -> 'list' | Convert to s-expression list. |
to_string | method | (self) -> 'str' | Serialize to KiCad PCB format string. |
to_svg | method | (self, layers: 'Optional[List[str]]' = None, fill: 'str' = '#000000', stroke: 'str' = '#000000', black_and_white: 'bool' = True, profile: 'str | None' = None, options: "Optional['KiCadSvgRenderOptions']" = None) -> 'str' | Render PCB to SVG using the plotter-IR pipeline. |
to_svg_ir | method | (self, layers: 'Optional[List[str]]' = None, fill: 'str' = '#000000', stroke: 'str' = '#000000', black_and_white: 'bool' = True, profile: 'str | None' = None, options: "Optional['KiCadSvgRenderOptions']" = None) -> 'str' | Render PCB via the plotter-IR pipeline. |
top_level_outline_items | method | (self, layer_name: 'str' = 'Edge.Cuts') -> 'List[object]' | Return top-level board graphics that carry the board outline. |
upsert_property | method | (self, key: 'str', value: 'str') -> 'BoardProperty' | Create or update a board property and return the property object. |
KiCadPcbProjection
classfrom kicad_monkey import KiCadPcbProjection
class KiCadPcbProjection(*, source_text: 'str | None' = None, source_path: 'Path | None' = None, board: "'KiCadPcb | None'" = None) -> 'None'
Lazy projection view over KiCad PCB source or a loaded ``KiCadPcb``.
Members (39)
| Member | Kind | Signature | Summary |
|---|---|---|---|
arcs | method | (self) -> 'list[Arc]' | |
barcodes | method | (self) -> 'list[Barcode]' | |
dimensions | method | (self) -> 'list[Dimension]' | |
embedded_files | method | (self) -> 'list[EmbeddedFile]' | |
embedded_fonts | method | (self) -> 'bool' | Return whether board-level embedded fonts are enabled. |
footprints | method | (self) -> 'list[Footprint]' | |
from_board | classmethod | (cls, board: "'KiCadPcb'") -> "'KiCadPcbProjection'" | Create a projection backed by an already parsed board. |
from_file | classmethod | (cls, path: 'str | Path') -> "'KiCadPcbProjection'" | Create a projection from a PCB file. |
generated_items | method | (self) -> 'list[GeneratedObject]' | |
gr_arcs | method | (self) -> 'list[GrArc]' | |
gr_circles | method | (self) -> 'list[GrCircle]' | |
gr_curves | method | (self) -> 'list[GrCurve]' | |
gr_lines | method | (self) -> 'list[GrLine]' | |
gr_polys | method | (self) -> 'list[GrPoly]' | |
gr_rects | method | (self) -> 'list[GrRect]' | |
gr_text_boxes | method | (self) -> 'list[GrTextBox]' | |
gr_texts | method | (self) -> 'list[GrText]' | |
groups | method | (self) -> 'list[Group]' | |
images | method | (self) -> 'list[Image]' | |
layers | method | (self) -> 'list[Layer]' | |
model_references | method | (self) -> 'list[PcbModelReference]' | Return footprint-owned 3D model references with parent context. |
nets | method | (self) -> 'list[Net]' | |
pads | method | (self) -> 'list[Pad]' | Return footprint-owned pads as normal ``Pad`` objects. |
properties | method | (self) -> 'list[BoardProperty]' | |
segments | method | (self) -> 'list[Segment]' | |
setup_sexp | method | (self) -> 'list | None' | Return the board ``setup`` S-expression, when present. |
source | method | (self, obj: 'object') -> 'ProjectedSource | None' | Return source metadata for a projected object, when available. |
source_sexp | method | (self, obj: 'object') -> 'list | None' | Return the source S-expression for a projected object. |
source_span | method | (self, obj: 'object') -> 'SexpFormSpan | None' | Return the exact source span for a projected object, when available. |
source_text | method | (self, obj: 'object') -> 'str | None' | Return exact source text for a projected object, when available. |
source_text_for | method | (self, obj: 'object') -> 'str | None' | Return exact source text for a projected object, when available. |
source_text_of | method | (self, obj: 'object') -> 'str | None' | Alias for ``source_text_for``. |
stackup | method | (self) -> 'Stackup | None' | Return the board stackup, when present. |
tables | method | (self) -> 'list[Table]' | |
title_block | method | (self) -> 'TitleBlock | None' | Return the board title block, when present. |
unknown_elements | method | (self) -> 'list[UnknownElement]' | Return unknown top-level forms as ``UnknownElement`` objects. |
variants | method | (self) -> 'list[BoardVariant]' | |
vias | method | (self) -> 'list[Via]' | |
zones | method | (self) -> 'list[Zone]' |
Layer
classfrom kicad_monkey import Layer
class Layer(ordinal: 'int', canonical_name: 'str', layer_type: 'LayerType', user_name: 'Optional[str]' = None) -> 'None'
Layer definition.
Members (2)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list') -> "'Layer'" | |
to_sexp | method | (self) -> 'list' |
Net
classfrom kicad_monkey import Net
class Net(ordinal: 'int', name: 'str') -> 'None'
Net definition.
Members (2)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list') -> "'Net'" | |
to_sexp | method | (self) -> 'list' |
NetTable
classfrom kicad_monkey import NetTable
class NetTable(name_by_ordinal: 'Mapping[int, str]') -> 'None'
Immutable snapshot of a board net table for repeated lookup.
Board models are mutable, so callers choose the snapshot lifetime and
rebuild it after changing ``KiCadPcb.nets``. This keeps bulk resolution
linear without hiding a potentially stale cache on the board.
Members (3)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_name_by_ordinal | classmethod | (cls, name_by_ordinal: 'Mapping[int, str]') -> "'NetTable'" | |
name_of | method | (self, net_ref: "Optional['NetRef']") -> 'str' | Return the resolved net name, or an empty string. |
resolve | method | (self, net_ref: "Optional['NetRef']") -> "'NetRef'" | Resolve a reference through this snapshot. |
Pad
classfrom kicad_monkey import Pad
class Pad(number: 'str', pad_type: 'PadType', shape: 'PadShape', at_x: 'float', at_y: 'float', at_angle: 'float' = 0.0, size_x: 'float' = 0.0, size_y: 'float' = 0.0, drill: 'Optional[float]' = None, drill_oval: 'bool' = False, drill_width: 'Optional[float]' = None, drill_height: 'Optional[float]' = None, drill_offset_x: 'Optional[float]' = None, drill_offset_y: 'Optional[float]' = None, layers: 'List[str]' = <factory>, net: 'NetRef' = <factory>, uuid: 'Optional[str]' = None, pinfunction: 'Optional[str]' = None, pintype: 'Optional[str]' = None, die_length: 'Optional[float]' = None, rect_delta_x: 'Optional[float]' = None, rect_delta_y: 'Optional[float]' = None, roundrect_rratio: 'Optional[float]' = None, chamfer_ratio: 'Optional[float]' = None, chamfer_corners: 'List[str]' = <factory>, solder_mask_margin: 'Optional[float]' = None, solder_paste_margin: 'Optional[float]' = None, solder_paste_margin_ratio: 'Optional[float]' = None, clearance: 'Optional[float]' = None, thermal_bridge_width: 'Optional[float]' = None, thermal_bridge_angle: 'Optional[float]' = None, thermal_gap: 'Optional[float]' = None, teardrops: 'Optional[TeardropParameters]' = None, zone_connect: 'Optional[int]' = None, remove_unused_layers: 'Optional[bool]' = None, keep_end_layers: 'Optional[bool]' = None, backdrill: 'Optional[DrillProps]' = None, tertiary_drill: 'Optional[DrillProps]' = None, front_post_machining: 'Optional[PostMachiningProps]' = None, back_post_machining: 'Optional[PostMachiningProps]' = None, zone_layer_connections: 'Optional[ZoneLayerConnections]' = None, custom_options: 'Optional[PadCustomOptions]' = None, custom_primitives: 'List[PadCustomPrimitive]' = <factory>, padstack: 'Padstack | None' = None, _raw_sexp: 'Optional[list]' = None, *, pad_property: 'Optional[str]' = None, tenting: "Optional['FrontBackOptBool']" = None, _drill_unknown: 'List[Any]' = <factory>, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Footprint pad.
Members (4)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list') -> "'Pad'" | |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box of this pad.. |
to_sexp | method | (self) -> 'list' | |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None) -> 'List[str]' | Render this pad to SVG elements.. |
PcbLayerFlashResolver
classfrom kicad_monkey import PcbLayerFlashResolver
class PcbLayerFlashResolver(copper_stack: 'tuple[str, ...]', _routing_shapes: 'dict[tuple[tuple[str, object], str], tuple[_GeometryCandidate, ...]]' = <factory>, _items_by_net: 'dict[tuple[str, object], tuple[_ConnectedItem, ...]]' = <factory>, _lazy_board: 'Any' = None, _connectivity_built: 'list[bool]' = <factory>, _routing_index: 'dict[tuple[tuple[str, object], str], _BoundsIndex]' = <factory>, _item_index: 'dict[tuple[str, object], _BoundsIndex]' = <factory>) -> 'None'
Board-scoped direct-connectivity evidence for PTH flash resolution.
KiCad's connectivity query considers traces, arcs, vias, and pads, while
zone connections are supplied by ``zone_layer_connections``. The source
model supplies the copper shapes needed for local collision checks without
conflating an entire net with a direct connection. KiCad's same-footprint
and conditional-pad exclusions are applied to coincident pad connectivity.
Members (6)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_board | classmethod | (cls, board: 'Any') -> "'PcbLayerFlashResolver'" | |
pad_flashes_layer | method | (self, pad: 'Any', footprint: 'Any', layer: 'str') -> 'bool' | Return whether ``pad`` is present on ``layer`` without unnecessary connectivity work. |
pad_item_layers | method | (self, pad: 'Any', footprint: 'Any') -> 'tuple[str, ...]' | |
via_flash_layers | method | (self, via: 'Any') -> 'tuple[str, ...]' | |
via_flashes_layer | method | (self, via: 'Any', layer: 'str') -> 'bool' | Return whether ``via`` flashes copper on ``layer`` without unnecessary connectivity work. |
via_item_layers | method | (self, via: 'Any') -> 'tuple[str, ...]' |
PcbModelReference
classfrom kicad_monkey import PcbModelReference
class PcbModelReference(footprint: 'Footprint', model: 'Model', footprint_span: 'SexpFormSpan | None' = None, model_span: 'SexpFormSpan | None' = None) -> 'None'
One footprint-owned 3D model reference from a projected board.
Members (3)
| Member | Kind | Signature | Summary |
|---|---|---|---|
path | property | -> 'str' | Return the referenced model path. |
reference | property | -> 'str' | Return the parent footprint reference, when present. |
value | property | -> 'str' | Return the parent footprint value, when present. |
ProjectedSource
classfrom kicad_monkey import ProjectedSource
class ProjectedSource(span: 'SexpFormSpan | None', parent_span: 'SexpFormSpan | None' = None) -> 'None'
Source metadata for one projected object.
Members (2)
| Member | Kind | Signature | Summary |
|---|---|---|---|
sexp | method | (self) -> 'list' | Parse and return the exact projected source form. |
text | method | (self) -> 'str' | Return the exact source text for the projected object. |
pcb_setup_policy
functionfrom kicad_monkey import pcb_setup_policy
def pcb_setup_policy(pcb, policy: 'str', side: 'str | None' = None) -> 'bool | None'
Read one authored via treatment setup value without default substitution.
This mirrors native PcbSetup source facts. Absence/none remains None;
consumers apply the governing effective rule after occurrence overrides.