kicad monkey v2026.11.30
On This Page (18)

PCB & Footprints

KiCadPcb, KiCadFootprint, pads, tracks, vias, zones, layer flash resolution, and board projection.

18 public symbols.

Footprint

class
from 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)
MemberKindSignatureSummary
add_objectmethod(self, obj: 'object') -> 'object'Add a typed object to the matching embedded-footprint-owned list.
from_sexpclassmethod(cls, sexp: 'list') -> "'Footprint'"
get_boundsmethod(self) -> "'BoundingBox'"Get bounding box of this footprint in board coordinates..
get_propertymethod(self, name: 'str') -> 'str | None'Get a footprint property value by name.
get_property_objectmethod(self, name: 'str') -> 'Property | None'Get a footprint property object by name.
get_property_valuemethod(self, name: 'str', default: 'str' = '') -> 'str'Get a footprint property value, returning default when absent.
is_dnpproperty -> 'bool'
is_excluded_from_bomproperty -> 'bool'
is_excluded_from_pos_filesproperty -> 'bool'
iter_objectsmethod(self) -> 'Iterator[object]'Iterate over embedded-footprint-owned objects.
iter_propertiesmethod(self) -> 'Iterator[Property]'Iterate over footprint properties.
objectsproperty -> "'KiCadObjectCollection'"Live read-only query view over embedded-footprint-owned objects.
outline_itemsmethod(self, layer_name: 'str' = 'Edge.Cuts') -> 'list[object]'Return footprint-local items that can act as board-outline carriers.
pathproperty -> 'str'
remove_objectmethod(self, obj: 'object') -> 'bool'Remove an object by identity from its owning footprint list.
remove_propertymethod(self, name: 'str') -> 'bool'Remove a footprint property by name.
remove_variant_overridemethod(self, name: 'str') -> 'bool'Drop the variant override named ``name``. Returns ``True`` if
set_property_valuemethod(self, name: 'str', value: 'str', *, create: 'bool' = False) -> 'bool'Set a footprint property value. Returns True if updated or created.
set_variant_overridemethod(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.
sheetfileproperty -> 'str'
sheetnameproperty -> 'str'
to_irmethod(self, *, document_id: 'str | None' = None, board: "'KiCadPcb | None'" = None) -> "'KiCadPlotterDocument'"Render this PCB-embedded footprint to a single-record plotter IR document.
to_sexpmethod(self) -> 'list'
to_svgmethod(self, ctx: "'SvgRenderContext | None'" = None) -> 'List[str]'Render this footprint to SVG elements..
upsert_propertymethod(self, name: 'str', value: 'str') -> 'Property'Create or update a footprint property and return the property object.

FpLine

class
from 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)
MemberKindSignatureSummary
from_sexpclassmethod(cls, sexp: 'list') -> "'FpLine'"
get_boundsmethod(self) -> "'BoundingBox'"Get bounding box of this line..
to_sexpmethod(self) -> 'list'
to_svgmethod(self, ctx: "'SvgRenderContext | None'" = None) -> 'List[str]'Render this line to SVG elements..

FpText

class
from 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)
MemberKindSignatureSummary
from_sexpclassmethod(cls, sexp: 'list') -> "'FpText'"
get_boundsmethod(self) -> "'BoundingBox'"Get bounding box of this text element..
h_alignproperty -> 'str'Get horizontal alignment.
is_mirroredproperty -> 'bool'Check if text is mirrored.
to_sexpmethod(self) -> 'list'
to_svgmethod(self, ctx: "'SvgRenderContext | None'" = None) -> 'List[str]'Render this text element to SVG..
to_text_paramsmethod(self, footprint: "'Optional[KiCadFootprint]'" = None) -> "'TextParams'"Convert footprint-local text to `TextParams` for outline rendering.
v_alignproperty -> 'str'Get vertical alignment.

FpTextBox

class
from 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)
MemberKindSignatureSummary
from_sexpclassmethod(cls, sexp: 'list') -> "'FpTextBox'"
get_boundsmethod(self) -> "'BoundingBox'"
render_cache_textmethod(self, text: 'Optional[str]' = None, footprint: "'Optional[KiCadFootprint]'" = None) -> 'str'Return resolved footprint text-box text after KiCad wrapping.
to_sexpmethod(self) -> 'list'
to_svgmethod(self, ctx: "'SvgRenderContext | None'" = None) -> 'list[str]'
to_text_paramsmethod(self, text: 'Optional[str]' = None, footprint: "'Optional[KiCadFootprint]'" = None) -> "'TextParams'"Convert footprint text-box content to `TextParams` for outline rendering.

GrLine

class
from 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)
MemberKindSignatureSummary
endproperty -> 'tuple[float, float]'Get end point as tuple.
from_sexpclassmethod(cls, sexp: 'list') -> "'GrLine'"Parse from s-expression.
get_boundsmethod(self) -> "'BoundingBox'"Return KiCad-style source geometry bounds.
startproperty -> 'tuple[float, float]'Get start point as tuple.
to_sexpmethod(self) -> 'list'Serialize to s-expression.
widthproperty -> 'float'Get stroke width.

GrText

class
from 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)
MemberKindSignatureSummary
fontproperty -> 'Font'Get font from effects.
from_sexpclassmethod(cls, sexp: 'list') -> "'GrText'"Parse from s-expression.
get_knockout_marginmethod(self) -> 'float'Calculate knockout text margin using KiCad's formula.
h_alignproperty -> 'str'Get horizontal alignment.
is_boldproperty -> 'bool'Check if text is bold.
is_italicproperty -> 'bool'Check if text is italic.
is_mirroredproperty -> 'bool'Check if text is mirrored (from justify).
positionproperty -> 'Tuple[float, float]'Get text position as tuple.
rendermethod(self) -> "'RenderedGeometry'"Render text to RenderedGeometry using the KiCad text renderer.
to_sexpmethod(self) -> 'list'Serialize to s-expression.
to_text_paramsmethod(self) -> "'TextParams'"Convert to TextParams for use with KiCadTextRenderer.
v_alignproperty -> 'str'Get vertical alignment.

GrTextBox

class
from 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)
MemberKindSignatureSummary
fontproperty -> 'Font'Return text-box font parameters, with KiCad defaults if absent.
from_sexpclassmethod(cls, sexp: 'list') -> "'GrTextBox'"
get_boundsmethod(self) -> "'BoundingBox'"Get bounding box of this text box..
h_alignproperty -> 'str'
is_mirroredproperty -> 'bool'
render_cache_textmethod(self, text: 'Optional[str]' = None) -> 'str'Return resolved text after KiCad text-box wrapping.
to_sexpmethod(self) -> 'list'
to_svgmethod(self, ctx: "'SvgRenderContext | None'" = None) -> 'List[str]'Render this text box to SVG elements..
to_text_paramsmethod(self, text: 'Optional[str]' = None) -> "'TextParams'"Convert board text-box content to `TextParams` for outline rendering.
v_alignproperty -> 'str'

KiCadFootprint

class
from 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)
MemberKindSignatureSummary
add_objectmethod(self, obj: 'object') -> 'object'Add a typed object to the matching footprint-owned list.
from_fileclassmethod(cls, path: 'Union[str, Path]') -> "'KiCadFootprint'"Load a KiCad footprint file. Deprecated: use ``KiCadFootprint(path)``.
from_sexpclassmethod(cls, sexp: 'list') -> "'KiCadFootprint'"Parse from s-expression list.
from_stringclassmethod(cls, content: 'str') -> "'KiCadFootprint'"Parse KiCad footprint content from string.
get_boundsmethod(self) -> "'BoundingBox'"Compute the bounding box of the entire footprint.
get_propertymethod(self, name: 'str') -> 'str | None'Get a footprint property value by name.
get_property_objectmethod(self, name: 'str') -> 'Property | None'Get a footprint property object by name.
get_property_valuemethod(self, name: 'str', default: 'str' = '') -> 'str'Get a footprint property value, returning default when absent.
iter_objectsmethod(self) -> 'Iterator[object]'Iterate over footprint-owned objects.
iter_propertiesmethod(self) -> 'Iterator[Property]'Iterate over footprint properties.
objectsproperty -> "'KiCadObjectCollection'"Live read-only query view over footprint-owned objects.
referenceproperty -> 'Optional[str]'Get the Reference property value.
remove_objectmethod(self, obj: 'object') -> 'bool'Remove an object by identity from its owning footprint list.
remove_propertymethod(self, name: 'str') -> 'bool'Remove a footprint property by name.
savemethod(self, path: 'Union[str, Path]') -> 'None'Save to a KiCad footprint file. Canonical save method per ADR-0043.
set_property_valuemethod(self, name: 'str', value: 'str', *, create: 'bool' = False) -> 'bool'Set a footprint property value. Returns True if updated or created.
to_filemethod(self, path: 'Union[str, Path]') -> 'None'Deprecated: use ``save()``.
to_irmethod(self, *, source_path: 'str | None' = None, document_id: 'str | None' = None) -> "'KiCadPlotterDocument'"Render this footprint to plotter IR.
to_sexpmethod(self) -> 'list'Convert to s-expression list.
to_stringmethod(self) -> 'str'Serialize to KiCad footprint format string.
to_svgmethod(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_propertymethod(self, name: 'str', value: 'str') -> 'Property'Create or update a footprint property and return the property object.
valueproperty -> 'Optional[str]'Get the Value property value.

KiCadPcb

class
from 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)
MemberKindSignatureSummary
add_objectmethod(self, obj: 'object') -> 'object'Add a typed object to the matching board-owned list.
aux_axis_origin_mmproperty -> 'tuple[float, float]'Return the KiCad ``setup/aux_axis_origin`` in millimeters.
bake_virtual_layersmethod(self, options: 'Any' = None, *, variant: 'Optional[str]' = None) -> 'Any'Bake selected virtual fab layers into KiCad ``User.*`` layers in place.
board_outline_carriersmethod(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.
fabmethod(self, *, variant: 'Optional[str]' = None, stem: 'Optional[str]' = None) -> 'Any'Build an analytic :class:`kicad_monkey.fab.Fab` facade for this PCB.
footprint_outline_itemsmethod(self, layer_name: 'str' = 'Edge.Cuts') -> 'List[OutlineCarrier]'Return footprint-local outline carriers promoted to board-level meaning.
from_fileclassmethod(cls, path: 'Union[str, Path]') -> "'KiCadPcb'"Load a KiCad PCB file. Deprecated: use ``KiCadPcb(path)``.
from_sexpclassmethod(cls, sexp: 'list') -> "'KiCadPcb'"Parse from s-expression list.
from_stringclassmethod(cls, content: 'str') -> "'KiCadPcb'"Parse KiCad PCB content from string.
get_boundsmethod(self, layers: 'Optional[List[str]]' = None) -> "'BoundingBox'"Get bounding box of this PCB..
get_propertymethod(self, key: 'str') -> 'str | None'Get a board property value by key.
get_property_objectmethod(self, key: 'str') -> 'BoardProperty | None'Get a board property object by key.
get_property_valuemethod(self, key: 'str', default: 'str' = '') -> 'str'Get a board property value, returning default when absent.
grid_origin_mmproperty -> 'tuple[float, float] | None'Read authored setup/grid_origin, preserving absence and zero.
iter_objectsmethod(self) -> 'Iterator[object]'Iterate over top-level board-owned objects.
iter_propertiesmethod(self) -> 'Iterator[BoardProperty]'Iterate over board properties.
net_name_by_ordinalmethod(self) -> 'dict[int, str]'Return the board net-name table keyed by ordinal.
net_tablemethod(self) -> 'NetTable'Build an immutable net-table snapshot for repeated resolution.
newclassmethod(cls, *, paper: 'str' = 'A4') -> "'KiCadPcb'"Create a blank, openable board with KiCad's default 2-layer stack.
objectsproperty -> "'KiCadObjectCollection'"Live read-only query view over board-owned objects.
remove_objectmethod(self, obj: 'object') -> 'bool'Remove an object by identity from its owning board list.
remove_propertymethod(self, key: 'str') -> 'bool'Remove a board property by key.
resolve_net_namemethod(self, net_ref: 'NetRef | None') -> 'str'Resolve a board-element net name from a NetRef.
resolve_net_refmethod(self, net_ref: 'NetRef | None') -> 'NetRef'Resolve a board-element net reference against the PCB net table when possible.
savemethod(self, path: 'Union[str, Path]') -> 'None'Save to a KiCad PCB file. Canonical save method per ADR-0043.
set_property_valuemethod(self, key: 'str', value: 'str', *, create: 'bool' = False) -> 'bool'Set a board property value. Returns True if updated or created.
source_inventorymethod(self, detail: 'str' = 'summary') -> 'dict'Return a ``kicad.pcb.source_inventory`` dict describing parser coverage.
to_filemethod(self, path: 'Union[str, Path]') -> 'None'Deprecated: use ``save()``.
to_irmethod(self, *, source_path: 'str | None' = None, document_id: 'str | None' = None) -> "'KiCadPlotterDocument'"Render this board to plotter IR.
to_sexpmethod(self) -> 'list'Convert to s-expression list.
to_stringmethod(self) -> 'str'Serialize to KiCad PCB format string.
to_svgmethod(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_irmethod(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_itemsmethod(self, layer_name: 'str' = 'Edge.Cuts') -> 'List[object]'Return top-level board graphics that carry the board outline.
upsert_propertymethod(self, key: 'str', value: 'str') -> 'BoardProperty'Create or update a board property and return the property object.

KiCadPcbProjection

class
from 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)
MemberKindSignatureSummary
arcsmethod(self) -> 'list[Arc]'
barcodesmethod(self) -> 'list[Barcode]'
dimensionsmethod(self) -> 'list[Dimension]'
embedded_filesmethod(self) -> 'list[EmbeddedFile]'
embedded_fontsmethod(self) -> 'bool'Return whether board-level embedded fonts are enabled.
footprintsmethod(self) -> 'list[Footprint]'
from_boardclassmethod(cls, board: "'KiCadPcb'") -> "'KiCadPcbProjection'"Create a projection backed by an already parsed board.
from_fileclassmethod(cls, path: 'str | Path') -> "'KiCadPcbProjection'"Create a projection from a PCB file.
generated_itemsmethod(self) -> 'list[GeneratedObject]'
gr_arcsmethod(self) -> 'list[GrArc]'
gr_circlesmethod(self) -> 'list[GrCircle]'
gr_curvesmethod(self) -> 'list[GrCurve]'
gr_linesmethod(self) -> 'list[GrLine]'
gr_polysmethod(self) -> 'list[GrPoly]'
gr_rectsmethod(self) -> 'list[GrRect]'
gr_text_boxesmethod(self) -> 'list[GrTextBox]'
gr_textsmethod(self) -> 'list[GrText]'
groupsmethod(self) -> 'list[Group]'
imagesmethod(self) -> 'list[Image]'
layersmethod(self) -> 'list[Layer]'
model_referencesmethod(self) -> 'list[PcbModelReference]'Return footprint-owned 3D model references with parent context.
netsmethod(self) -> 'list[Net]'
padsmethod(self) -> 'list[Pad]'Return footprint-owned pads as normal ``Pad`` objects.
propertiesmethod(self) -> 'list[BoardProperty]'
segmentsmethod(self) -> 'list[Segment]'
setup_sexpmethod(self) -> 'list | None'Return the board ``setup`` S-expression, when present.
sourcemethod(self, obj: 'object') -> 'ProjectedSource | None'Return source metadata for a projected object, when available.
source_sexpmethod(self, obj: 'object') -> 'list | None'Return the source S-expression for a projected object.
source_spanmethod(self, obj: 'object') -> 'SexpFormSpan | None'Return the exact source span for a projected object, when available.
source_textmethod(self, obj: 'object') -> 'str | None'Return exact source text for a projected object, when available.
source_text_formethod(self, obj: 'object') -> 'str | None'Return exact source text for a projected object, when available.
source_text_ofmethod(self, obj: 'object') -> 'str | None'Alias for ``source_text_for``.
stackupmethod(self) -> 'Stackup | None'Return the board stackup, when present.
tablesmethod(self) -> 'list[Table]'
title_blockmethod(self) -> 'TitleBlock | None'Return the board title block, when present.
unknown_elementsmethod(self) -> 'list[UnknownElement]'Return unknown top-level forms as ``UnknownElement`` objects.
variantsmethod(self) -> 'list[BoardVariant]'
viasmethod(self) -> 'list[Via]'
zonesmethod(self) -> 'list[Zone]'

Layer

class
from kicad_monkey import Layer
class Layer(ordinal: 'int', canonical_name: 'str', layer_type: 'LayerType', user_name: 'Optional[str]' = None) -> 'None'

Layer definition.

Members (2)
MemberKindSignatureSummary
from_sexpclassmethod(cls, sexp: 'list') -> "'Layer'"
to_sexpmethod(self) -> 'list'

Net

class
from kicad_monkey import Net
class Net(ordinal: 'int', name: 'str') -> 'None'

Net definition.

Members (2)
MemberKindSignatureSummary
from_sexpclassmethod(cls, sexp: 'list') -> "'Net'"
to_sexpmethod(self) -> 'list'

NetTable

class
from 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)
MemberKindSignatureSummary
from_name_by_ordinalclassmethod(cls, name_by_ordinal: 'Mapping[int, str]') -> "'NetTable'"
name_ofmethod(self, net_ref: "Optional['NetRef']") -> 'str'Return the resolved net name, or an empty string.
resolvemethod(self, net_ref: "Optional['NetRef']") -> "'NetRef'"Resolve a reference through this snapshot.

Pad

class
from 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)
MemberKindSignatureSummary
from_sexpclassmethod(cls, sexp: 'list') -> "'Pad'"
get_boundsmethod(self) -> "'BoundingBox'"Get bounding box of this pad..
to_sexpmethod(self) -> 'list'
to_svgmethod(self, ctx: "'SvgRenderContext | None'" = None) -> 'List[str]'Render this pad to SVG elements..

PcbLayerFlashResolver

class
from 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)
MemberKindSignatureSummary
from_boardclassmethod(cls, board: 'Any') -> "'PcbLayerFlashResolver'"
pad_flashes_layermethod(self, pad: 'Any', footprint: 'Any', layer: 'str') -> 'bool'Return whether ``pad`` is present on ``layer`` without unnecessary connectivity work.
pad_item_layersmethod(self, pad: 'Any', footprint: 'Any') -> 'tuple[str, ...]'
via_flash_layersmethod(self, via: 'Any') -> 'tuple[str, ...]'
via_flashes_layermethod(self, via: 'Any', layer: 'str') -> 'bool'Return whether ``via`` flashes copper on ``layer`` without unnecessary connectivity work.
via_item_layersmethod(self, via: 'Any') -> 'tuple[str, ...]'

PcbModelReference

class
from 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)
MemberKindSignatureSummary
pathproperty -> 'str'Return the referenced model path.
referenceproperty -> 'str'Return the parent footprint reference, when present.
valueproperty -> 'str'Return the parent footprint value, when present.

ProjectedSource

class
from kicad_monkey import ProjectedSource
class ProjectedSource(span: 'SexpFormSpan | None', parent_span: 'SexpFormSpan | None' = None) -> 'None'

Source metadata for one projected object.

Members (2)
MemberKindSignatureSummary
sexpmethod(self) -> 'list'Parse and return the exact projected source form.
textmethod(self) -> 'str'Return the exact source text for the projected object.

pcb_setup_policy

function
from 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.

kicad-monkey v2026.11.30·Docs updated 2026.12.01 15:43 UTC (fd9b75b)