On This Page (21)
Schematics & Symbols
KiCadSchematic, KiCadSymbolLib, symbol graphics, pins, properties, and hierarchical sheets.
21 public symbols.
KiCadSchematic
classfrom kicad_monkey import KiCadSchematic
class KiCadSchematic(path: 'Path | str | None' = None)
KiCad schematic document (.kicad_sch).
This is the top-level parser for schematic files. It handles:
- Paper size and title block
- Local symbol definitions (lib_symbols)
- Placed symbol instances
- Wires, buses, junctions, and other connectivity
- Labels (local, global, hierarchical)
- Hierarchical sheets
- Instance path data for multi-sheet designs
Example:
>>> sch = KiCadSchematic("design.kicad_sch")
>>> for sym in sch.symbols:
Members (24)
| Member | Kind | Signature | Summary |
|---|---|---|---|
add_object | method | (self, obj: 'object') -> 'object' | Add a typed object to the matching schematic-owned list. |
embed_worksheet | method | (self, path: 'Path | str') -> 'EmbeddedFile' | Embed a ``.wks`` drawing sheet into this schematic. |
from_file | classmethod | (cls, path: 'Path | str') -> "'KiCadSchematic'" | Load schematic (and any sub-sheets) from file. |
from_sexp | classmethod | (cls, sexp: 'list') -> "'KiCadSchematic'" | Parse from S-expression list. |
from_text | classmethod | (cls, text: 'str') -> "'KiCadSchematic'" | Parse schematic from text. |
get_lib_symbol | method | (self, lib_id: 'str') -> "Optional['LibSymbol']" | Get library symbol definition by lib_id. |
get_lib_symbol_for_symbol | method | (self, symbol: "'SchSymbol'") -> "Optional['LibSymbol']" | Get the library symbol definition for a placed symbol instance. |
get_sheet_by_name | method | (self, name: 'str') -> "Optional['SchSheet']" | Get hierarchical sheet by name. |
get_symbol_by_reference | method | (self, ref: 'str') -> "Optional['SchSymbol']" | Get placed symbol by reference designator. |
get_symbols_by_lib_id | method | (self, lib_id: 'str') -> "List['SchSymbol']" | Get all placed symbols using a given lib_id. |
iter_objects | method | (self) -> 'Iterator[object]' | Iterate over top-level schematic-owned objects. |
iter_properties | method | (self) -> 'Iterator[object]' | Iterate over properties attached to schematic-owned objects. |
load_page | classmethod | (cls, path: 'Path | str') -> "'KiCadSchematic'" | Load a root schematic and its sheets without ever stopping. |
objects | property | | Live read-only query view over schematic-owned objects. |
properties | property | | Live read-only query view over schematic-owned properties. |
remove_object | method | (self, obj: 'object') -> 'bool' | Remove an object by identity from its owning schematic list. |
save | method | (self, path: 'Path | str') -> 'None' | Save schematic to file. Canonical save method per ADR-0043. |
to_file | method | (self, path: 'Path | str') -> 'None' | Deprecated: use ``save()``. |
to_ir | method | (self, **kwargs) | Render schematic to plotter IR. |
to_sexp | method | (self) -> 'list' | Serialize to S-expression list. |
to_svg | method | (self, **kwargs) -> 'str' | Render schematic to SVG through the plotter-IR pipeline. |
to_text | method | (self) -> 'str' | Serialize to formatted S-expression text. |
walk_sheets | method | (self) -> "Iterator[tuple['SchSheet', 'KiCadSchematic']]" | Yield ``(sheet, child_schematic)`` for every sheet in the hierarchy. |
walk_symbols | method | (self, _sheet_path: 'str' = '', *, include_off_board_sheets: 'bool' = True) -> "Iterator[tuple['SchSymbol', str, 'KiCadSchematic']]" | Yield every placed symbol across the full sheet hierarchy. |
KiCadSymbolLib
classfrom kicad_monkey import KiCadSymbolLib
class KiCadSymbolLib(path: 'Path | str | None' = None, *, version: 'int' = 20251024, generator: 'str' = 'kicad_symbol_editor', generator_version: 'str' = '10.0', symbols: "list['LibSymbol'] | None" = None)
KiCad symbol library (.kicad_sym) file.
Example:
>>> lib = KiCadSymbolLib("symbols.kicad_sym")
>>> for symbol in lib.symbols:
... print(symbol.name)
>>> lib.save("output.kicad_sym")
Members (18)
| Member | Kind | Signature | Summary |
|---|---|---|---|
add_symbol | method | (self, symbol: "'LibSymbol'") -> 'None' | Add a symbol to the library. |
from_directory | classmethod | (cls, directory: 'Path | str', recursive: 'bool' = True) -> "'KiCadSymbolLib'" | Merge all symbol library files from a directory into a single library. |
from_file | classmethod | (cls, path: 'Path | str') -> "'KiCadSymbolLib'" | Load symbol library from file. Deprecated: use ``KiCadSymbolLib(path)``. |
from_files | classmethod | (cls, files: 'Iterable[Path | str]') -> "'KiCadSymbolLib'" | Merge multiple symbol library files into a single library. |
from_sexp | classmethod | (cls, sexp: 'list') -> "'KiCadSymbolLib'" | Parse from S-expression list. |
from_text | classmethod | (cls, text: 'str') -> "'KiCadSymbolLib'" | Parse symbol library from text. |
get_symbol | method | (self, name: 'str') -> "'LibSymbol | None'" | Get symbol by name. |
remove_symbol | method | (self, name: 'str') -> 'bool' | Remove symbol by name. |
save | method | (self, path: 'Path | str') -> 'None' | Save symbol library to file. Canonical save method per ADR-0043. |
split_to_directory | method | (self, output_dir: 'Path | str', overwrite: 'bool' = False) -> 'int' | Split this library into individual .kicad_sym files, one per symbol. |
symbol_names | method | (self) -> 'List[str]' | Get list of all symbol names. |
symbol_to_ir | method | (self, symbol_name: 'str', *, unit: 'int | None' = None, part_id: 'int | None' = None, style: 'int' = 0) | Render one symbol from this library to plotter IR. |
symbol_to_svg | method | (self, symbol_name: 'str', *, unit: 'int | None' = None, part_id: 'int | None' = None, style: 'int' = 0, theme=None, options=None) -> 'str' | Render one symbol from this library as standalone SVG. |
to_file | method | (self, path: 'Path | str') -> 'None' | Deprecated: use ``save()``. |
to_ir | method | (self, symbol_name: 'str', **kwargs) | Render one symbol from this library to plotter IR. |
to_sexp | method | (self) -> 'list' | Serialize to S-expression list. |
to_svg | method | (self, output_dir: 'Path | str | None' = None, *, style: 'int' = 0, theme=None) -> 'dict[str, dict[int, str]]' | Render every symbol/unit in the library to SVG. |
to_text | method | (self) -> 'str' | Serialize to formatted S-expression text. |
LibSubSymbol
classfrom kicad_monkey import LibSubSymbol
class LibSubSymbol(name: 'str', unit: 'int' = 1, style: 'int' = 0, unit_name: 'Optional[str]' = None, arcs: "List['SymArc']" = <factory>, circles: "List['SymCircle']" = <factory>, polylines: "List['SymPolyline']" = <factory>, rectangles: "List['SymRectangle']" = <factory>, beziers: "List['SymBezier']" = <factory>, texts: "List['SymText']" = <factory>, text_boxes: "List['SymTextBox']" = <factory>, pins: "List['SymPin']" = <factory>, _raw_sexp: 'list | None' = None, *, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Sub-symbol representing a unit/style variant.
Multi-unit symbols (like op-amps, quad gates) have multiple sub-symbols.
The naming convention is "ParentName_unit_style":
- unit: 1-based unit number (0 = common to all units)
- style: 0 = normal, 1 = De Morgan alternate
Examples:
- LM324_0_0: Common elements for all units
- LM324_1_0: Unit 1, normal style
- LM324_1_1: Unit 1, De Morgan style
- LM324_2_0: Unit 2, normal style
Members (6)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list', parent_name: 'str') -> "'LibSubSymbol'" | Parse from (symbol "ParentName_1_0" ...) element. |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box of all elements including text. |
is_common | property | -> 'bool' | Check if this sub-symbol contains elements common to all units. |
is_demorgan | property | -> 'bool' | Check if this is a De Morgan alternate style. |
to_sexp | method | (self) -> 'list' | Serialize to S-expression list. |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None) -> 'list[str]' | Render sub-symbol to SVG elements. |
LibSymbol
classfrom kicad_monkey import LibSymbol
class LibSymbol(name: 'str', extends: 'Optional[str]' = None, pin_numbers_hide: 'bool' = False, pin_names_hide: 'bool' = False, pin_names_offset: 'float' = 0.508, in_bom: 'bool' = True, on_board: 'bool' = True, exclude_from_sim: 'bool' = False, power: 'bool' = False, power_kind: 'Optional[str]' = None, duplicate_pin_numbers_are_jumpers: 'bool' = False, jumper_pin_groups: 'List[List[str]]' = <factory>, has_demorgan_body_styles: 'bool' = False, body_style_names: 'List[str]' = <factory>, properties: "List['SymProperty']" = <factory>, subsymbols: "List['LibSubSymbol']" = <factory>, embedded_fonts: 'List[str]' = <factory>, _raw_sexp: 'Optional[list]' = None, *, in_pos_files: 'Optional[bool]' = None, _has_pin_numbers: 'bool' = False, _pin_numbers_hide_explicit_no: 'bool' = False, _pin_numbers_unknown: 'List[Any]' = <factory>, _has_pin_names: 'bool' = False, _has_pin_names_offset: 'bool' = False, _pin_names_hide_explicit_no: 'bool' = False, _pin_names_unknown: 'List[Any]' = <factory>, _exclude_from_sim_explicit_no: 'bool' = False, _dup_pins_explicit_no: 'bool' = False, _has_jumper_pin_groups: 'bool' = False, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Symbol definition in a .kicad_sym library.
Supports symbol inheritance via 'extends' keyword.
Power symbols typically extend a base symbol.
Attributes:
name: Symbol name (unique within library)
extends: Parent symbol name if this symbol extends another
pin_numbers_hide: Hide pin numbers on schematic
pin_names_hide: Hide pin names on schematic
pin_names_offset: Offset of pin names from symbol body
in_bom: Include in Bill of Materials
on_board: Include on PCB
exclude_from_sim: Exclude from SPICE simulation
Members (20)
| Member | Kind | Signature | Summary |
|---|---|---|---|
datasheet | property | -> 'str' | Get datasheet property. |
description | property | -> 'str' | Get description property. |
footprint | property | -> 'str' | Get footprint property. |
from_sexp | classmethod | (cls, sexp: 'list') -> "'LibSymbol'" | Parse symbol from S-expression. |
get_all_pins | method | (self) -> 'List' | Get all pins from all subsymbols. |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box of all graphical elements. |
get_property | method | (self, key: 'str | StandardPropertyKey') -> "'SymProperty | None'" | Get property by key name. |
get_property_value | method | (self, key: 'str | StandardPropertyKey', default: 'str' = '') -> 'str' | Get property value by key name. |
get_subsymbol | method | (self, unit: 'int' = 1, style: 'int' = 0) -> "'LibSubSymbol | None'" | Get subsymbol for specific unit and style. |
has_demorgan | property | -> 'bool' | Check if this symbol has De Morgan alternate representation. |
iter_properties | method | (self) -> "Iterator['SymProperty']" | Iterate over symbol properties. |
reference | property | -> 'str' | Get reference designator prefix (e.g., 'U', 'R'). |
remove_property | method | (self, key: 'str | StandardPropertyKey') -> 'bool' | Remove a property by key name. |
set_property_value | method | (self, key: 'str | StandardPropertyKey', value: 'str', *, create: 'bool' = False) -> 'bool' | Set property value. Returns True if a property was updated or created. |
to_ir | method | (self, *, unit: 'int | None' = None, part_id: 'int | None' = None, style: 'int' = 0, source_path: 'str | None' = None, document_id: 'str | None' = None, **kwargs) | Render this symbol definition to plotter IR. |
to_sexp | method | (self) -> 'list' | Serialize to S-expression. |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None, unit: 'int' = 1, style: 'int' = 0) -> 'List[str]' | Render symbol to SVG elements. |
unit_count | property | -> 'int' | Get the number of units in this symbol. |
upsert_property | method | (self, key: 'str | StandardPropertyKey', value: 'str', *, property_id: 'int | PropertyId | None' = None) -> "'SymProperty'" | Create or update a property and return the property object. |
value | property | -> 'str' | Get value property. |
SchSheet
classfrom kicad_monkey import SchSheet
class SchSheet(at_x: 'float' = 0.0, at_y: 'float' = 0.0, size_x: 'float' = 50.8, size_y: 'float' = 35.56, exclude_from_sim: 'bool' = False, in_bom: 'bool' = True, on_board: 'bool' = True, dnp: 'bool' = False, fields_autoplaced: 'bool' = False, stroke: 'Stroke' = <factory>, fill_color: 'Optional[Tuple[int, int, int, float]]' = None, uuid: 'str' = '', properties: 'List[SchSheetProperty]' = <factory>, pins: 'List[SchSheetPin]' = <factory>, instances: 'List[SchSheetInstance]' = <factory>, _raw_sexp: 'Optional[list]' = None, *, _has_empty_uuid: 'bool' = False, _fill_unknown: 'List[Any]' = <factory>, _has_instances: 'bool' = False, _instances_unknown: 'List[Any]' = <factory>, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Hierarchical sheet symbol in a schematic.
Members (11)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list') -> "'SchSheet'" | Parse from (sheet (at X Y) (size W H) ...). |
get_property | method | (self, key: 'str | StandardSheetPropertyKey') -> 'Optional[str]' | Get property value by key. |
get_property_object | method | (self, key: 'str | StandardSheetPropertyKey', *, legacy_key: 'str | StandardSheetPropertyKey | None' = None) -> 'SchSheetProperty | None' | Get a sheet property object by key. |
get_property_value | method | (self, key: 'str | StandardSheetPropertyKey', default: 'str' = '', *, legacy_key: 'str | StandardSheetPropertyKey | None' = None) -> 'str' | Get property value by key, returning default when absent. |
iter_properties | method | (self) -> 'Iterator[SchSheetProperty]' | Iterate over hierarchical sheet properties. |
remove_property | method | (self, key: 'str | StandardSheetPropertyKey') -> 'bool' | Remove a sheet property by key. |
set_property_value | method | (self, key: 'str | StandardSheetPropertyKey', value: 'str', *, create: 'bool' = False) -> 'bool' | Set property value. Returns True if a property was updated or created. |
sheet_file | property | -> 'str' | Get sheet file from properties (accepts pre-9.0 ``Sheet file``). |
sheet_name | property | -> 'str' | Get sheet name from properties. |
to_sexp | method | (self) -> 'list' | Serialize to S-expression list. |
upsert_property | method | (self, key: 'str | StandardSheetPropertyKey', value: 'str') -> 'SchSheetProperty' | Create or update a sheet property and return the property object. |
SchSymbol
classfrom kicad_monkey import SchSymbol
class SchSymbol(lib_id: 'str' = '', lib_name: 'str' = '', at_x: 'float' = 0.0, at_y: 'float' = 0.0, at_angle: 'float' = 0.0, mirror: 'Optional[str]' = None, unit: 'int' = 1, convert: 'int' = 1, exclude_from_sim: 'bool' = False, in_bom: 'bool' = True, on_board: 'bool' = True, in_pos_files: 'bool' = True, dnp: 'bool' = False, fields_autoplaced: 'bool' = False, properties: 'list' = <factory>, pins: 'List[SchSymbolPin]' = <factory>, instances: 'List[SchSymbolInstance]' = <factory>, uuid: 'str' = '', _raw_sexp: 'Optional[list]' = None, *, body_style: 'Optional[int]' = None, _has_empty_uuid: 'bool' = False, _has_instances: 'bool' = False, _instances_unknown: 'List[Any]' = <factory>, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Placed symbol instance in a schematic.
This is NOT the symbol definition - it's a placed instance that references
a symbol from lib_symbols via lib_id.
Members (14)
| Member | Kind | Signature | Summary |
|---|---|---|---|
footprint | property | -> 'str' | Get footprint from properties. |
from_sexp | classmethod | (cls, sexp: 'list') -> "'SchSymbol'" | Parse from (symbol (lib_id "...") (at X Y A) ...). |
get_property | method | (self, key: 'str | StandardPropertyKey') -> 'Optional[str]' | Get property value by key. |
get_property_object | method | (self, key: 'str | StandardPropertyKey') | Get a property object by key. |
get_property_value | method | (self, key: 'str | StandardPropertyKey', default: 'str' = '') -> 'str' | Get property value by key, returning default when absent. |
iter_properties | method | (self) -> 'Iterator[object]' | Iterate over symbol instance properties. |
reference | property | -> 'str' | Get reference designator from properties. |
remove_property | method | (self, key: 'str | StandardPropertyKey') -> 'bool' | Remove a property by key name. |
remove_variant_override | method | (self, name: 'str', *, instance_path: 'Optional[str]' = None, project: 'Optional[str]' = None) -> 'bool' | Drop the variant override named ``name`` from the matching |
set_property_value | method | (self, key: 'str | StandardPropertyKey', value: 'str', *, create: 'bool' = False) -> 'bool' | Set property value. Returns True if a property was updated or created. |
set_variant_override | method | (self, name: 'str', *, dnp: 'Optional[bool]' = None, exclude_from_sim: 'Optional[bool]' = None, in_bom: 'Optional[bool]' = None, on_board: 'Optional[bool]' = None, in_pos_files: 'Optional[bool]' = None, fields: 'Optional[Dict[str, str]]' = None, instance_path: 'Optional[str]' = None, project: 'Optional[str]' = None, replace_fields: 'bool' = False) -> 'SchSymbolInstanceVariant' | Add or update a per-variant override on a symbol instance. |
to_sexp | method | (self) -> 'list' | Serialize to S-expression list. |
upsert_property | method | (self, key: 'str | StandardPropertyKey', value: 'str', *, property_id: 'int | PropertyId | None' = None) | Create or update a property and return the property object. |
value | property | -> 'str' | Get value from properties. |
SymArc
classfrom kicad_monkey import SymArc
class SymArc(start_x: 'float', start_y: 'float', mid_x: 'float', mid_y: 'float', end_x: 'float', end_y: 'float', stroke: 'Stroke' = <factory>, fill: 'SymFill' = <factory>, uuid: 'Optional[str]' = None, _raw_sexp: 'Optional[list]' = None, *, _has_empty_uuid: 'bool' = False, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Arc graphic element in a symbol.
KiCad arcs are defined by start, mid, and end points.
The mid point defines the arc's curvature direction.
Members (4)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list') -> "'SymArc'" | Parse from (arc (start X Y) (mid X Y) (end X Y) ...). |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box of the arc. |
to_sexp | method | (self) -> 'list' | Serialize to S-expression list. |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None) -> 'list[str]' | Render arc to SVG path element. |
SymBezier
classfrom kicad_monkey import SymBezier
class SymBezier(points: 'List[Tuple[float, float]]' = <factory>, stroke: 'Stroke' = <factory>, fill: 'SymFill' = <factory>, uuid: 'Optional[str]' = None, _raw_sexp: 'Optional[list]' = None, *, _has_empty_uuid: 'bool' = False, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Bezier curve graphic element in a symbol.
KiCad beziers are defined by a list of control points.
Typically 4 points for a cubic bezier.
Members (4)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list') -> "'SymBezier'" | Parse from (bezier (pts (xy X Y) ...) ...). |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box of the bezier (approximation using control points). |
to_sexp | method | (self) -> 'list' | Serialize to S-expression list. |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None) -> 'list[str]' | Render bezier to SVG path element. |
SymCircle
classfrom kicad_monkey import SymCircle
class SymCircle(center_x: 'float', center_y: 'float', radius: 'float', stroke: 'Stroke' = <factory>, fill: 'SymFill' = <factory>, uuid: 'Optional[str]' = None, _raw_sexp: 'Optional[list]' = None, *, _has_empty_uuid: 'bool' = False, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Circle graphic element in a symbol.
Defined by center point and radius.
Members (4)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list') -> "'SymCircle'" | Parse from (circle (center X Y) (radius R) ...). |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box of the circle. |
to_sexp | method | (self) -> 'list' | Serialize to S-expression list. |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None) -> 'list[str]' | Render circle to SVG element. |
SymPin
classfrom kicad_monkey import SymPin
class SymPin(electrical_type: 'PinElectricalType', graphic_style: 'PinGraphicStyle', at_x: 'float', at_y: 'float', at_angle: 'float' = 0.0, length: 'float' = 2.54, name: 'str' = '', name_effects: 'Optional[Effects]' = None, number: 'str' = '', number_effects: 'Optional[Effects]' = None, hide: 'bool' = False, alternates: 'List[PinAlternate]' = <factory>, uuid: 'Optional[str]' = None, _raw_sexp: 'Optional[list]' = None, *, _hide_explicit_no: 'bool' = False, _has_empty_uuid: 'bool' = False, _name_unknown: 'List[Any]' = <factory>, _number_unknown: 'List[Any]' = <factory>, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Symbol pin definition.
Pins have:
- Electrical type: defines ERC behavior (input, output, bidirectional, etc.)
- Graphic style: visual appearance (line, inverted, clock, etc.)
- Position and orientation
- Name and number with optional effects
- Optional alternate functions
Members (5)
| Member | Kind | Signature | Summary |
|---|---|---|---|
end_point | property | -> 'tuple[float, float]' | Get the body connection point (pin root) of the pin. |
from_sexp | classmethod | (cls, sexp: 'list') -> "'SymPin'" | Parse from (pin electrical_type graphic_style (at X Y A) ...). |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box including pin length. |
to_sexp | method | (self) -> 'list' | Serialize to S-expression list. |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None) -> 'list[str]' | Render pin to SVG elements. |
SymPolyline
classfrom kicad_monkey import SymPolyline
class SymPolyline(points: 'List[Tuple[float, float]]' = <factory>, stroke: 'Stroke' = <factory>, fill: 'SymFill' = <factory>, uuid: 'Optional[str]' = None, _raw_sexp: 'Optional[list]' = None, *, _has_empty_uuid: 'bool' = False, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Polyline graphic element in a symbol.
A series of connected line segments defined by a list of points.
Can be filled to create a polygon.
Members (4)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list') -> "'SymPolyline'" | Parse from (polyline (pts (xy X Y) (xy X Y) ...) ...). |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box of the polyline. |
to_sexp | method | (self) -> 'list' | Serialize to S-expression list. |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None) -> 'list[str]' | Render polyline to SVG element. |
SymProperty
classfrom kicad_monkey import SymProperty
class SymProperty(key: 'str', value: 'str', id: 'int' = 0, at_x: 'float' = 0.0, at_y: 'float' = 0.0, at_angle: 'float' = 0.0, effects: 'Optional[Effects]' = None, show_name: 'bool' = False, do_not_autoplace: 'bool' = False, hide: 'bool' = False, _raw_sexp: 'Optional[list]' = None, *, _show_name_explicit_no: 'bool' = False, _do_not_autoplace_explicit_no: 'bool' = False, _hide_on_self: 'bool' = False, _hide_explicit_no: 'bool' = False, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Symbol property definition.
Properties have an ID ordinal that determines their type:
- 0: Reference (e.g., "U1")
- 1: Value (e.g., "LM358")
- 2: Footprint
- 3: Datasheet
- 4: Description
- 5+: User-defined properties
See PropertyId class in kicad_sch_enums for constants.
Members (6)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list') -> "'SymProperty'" | Parse from (property "key" "value" (id N) (at X Y A) ...). |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box of this property text. |
is_footprint | property | -> 'bool' | Check if this is the Footprint property. |
is_reference | property | -> 'bool' | Check if this is the Reference property. |
is_value | property | -> 'bool' | Check if this is the Value property. |
to_sexp | method | (self) -> 'list' | Serialize to S-expression list. |
SymRectangle
classfrom kicad_monkey import SymRectangle
class SymRectangle(start_x: 'float', start_y: 'float', end_x: 'float', end_y: 'float', stroke: 'Stroke' = <factory>, fill: 'SymFill' = <factory>, uuid: 'Optional[str]' = None, _raw_sexp: 'Optional[list]' = None, *, _has_empty_uuid: 'bool' = False, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Rectangle graphic element in a symbol.
Members (4)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list') -> "'SymRectangle'" | Parse from (rectangle (start X Y) (end X Y) (stroke ...) (fill ...)). |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box of the rectangle. |
to_sexp | method | (self) -> 'list' | Serialize to S-expression list. |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None) -> 'list[str]' | Render rectangle to SVG elements. |
SymText
classfrom kicad_monkey import SymText
class SymText(text: 'str', at_x: 'float' = 0.0, at_y: 'float' = 0.0, at_angle: 'float' = 0.0, effects: 'Optional[Effects]' = None, hide: 'bool' = False, uuid: 'Optional[str]' = None, _raw_sexp: 'Optional[list]' = None, *, _has_empty_uuid: 'bool' = False, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Text element in a symbol.
Static text that appears on the symbol graphics (not a property).
Members (4)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list') -> "'SymText'" | Parse from (text "content" (at X Y A) (effects ...)). |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box of the text (approximate). |
to_sexp | method | (self) -> 'list' | Serialize to S-expression list. |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None) -> 'list[str]' | Render text to SVG element. |
SymTextBox
classfrom kicad_monkey import SymTextBox
class SymTextBox(text: 'str', at_x: 'float' = 0.0, at_y: 'float' = 0.0, at_angle: 'float' = 0.0, size_x: 'float' = 10.0, size_y: 'float' = 5.0, stroke: 'Stroke' = <factory>, fill: 'SymFill' = <factory>, effects: 'Optional[Effects]' = None, uuid: 'Optional[str]' = None, _raw_sexp: 'Optional[list]' = None, *, _has_empty_uuid: 'bool' = False, _unknown_sexp: 'List[Any]' = <factory>) -> 'None'
Text box element in a symbol.
A rectangular text container with optional border and fill.
Members (4)
| Member | Kind | Signature | Summary |
|---|---|---|---|
from_sexp | classmethod | (cls, sexp: 'list') -> "'SymTextBox'" | Parse from (text_box "content" (at X Y A) (size W H) ...). |
get_bounds | method | (self) -> "'BoundingBox'" | Get bounding box of the text box. |
to_sexp | method | (self) -> 'list' | Serialize to S-expression list. |
to_svg | method | (self, ctx: "'SvgRenderContext | None'" = None) -> 'list[str]' | Render text box to SVG elements. |
LabelShape
enumfrom kicad_monkey import LabelShape
enum LabelShape
Global/hierarchical label shape.
Defines the visual shape of net labels that indicate signal direction.
Members (9)
| Member | Kind | Signature | Summary |
|---|---|---|---|
INPUT | member | = 'input' | |
OUTPUT | member | = 'output' | |
BIDIRECTIONAL | member | = 'bidirectional' | |
TRI_STATE | member | = 'tri_state' | |
PASSIVE | member | = 'passive' | |
DOT | member | = 'dot' | |
ROUND | member | = 'round' | |
DIAMOND | member | = 'diamond' | |
RECTANGLE | member | = 'rectangle' |
PinElectricalType
enumfrom kicad_monkey import PinElectricalType
enum PinElectricalType
Pin electrical type (KiCad ELECTRICAL_PINTYPE).
Defines the electrical characteristics of a pin for ERC (Electrical Rules Check).
Members (12)
| Member | Kind | Signature | Summary |
|---|---|---|---|
INPUT | member | = 'input' | |
OUTPUT | member | = 'output' | |
BIDIRECTIONAL | member | = 'bidirectional' | |
TRI_STATE | member | = 'tri_state' | |
PASSIVE | member | = 'passive' | |
FREE | member | = 'free' | |
UNSPECIFIED | member | = 'unspecified' | |
POWER_IN | member | = 'power_in' | |
POWER_OUT | member | = 'power_out' | |
OPEN_COLLECTOR | member | = 'open_collector' | |
OPEN_EMITTER | member | = 'open_emitter' | |
NO_CONNECT | member | = 'no_connect' |
PinGraphicStyle
enumfrom kicad_monkey import PinGraphicStyle
enum PinGraphicStyle
Pin graphic style (KiCad GRAPHIC_PINSHAPE).
Defines the visual appearance of the pin connection point.
Members (9)
| Member | Kind | Signature | Summary |
|---|---|---|---|
LINE | member | = 'line' | |
INVERTED | member | = 'inverted' | |
CLOCK | member | = 'clock' | |
INVERTED_CLOCK | member | = 'inverted_clock' | |
INPUT_LOW | member | = 'input_low' | |
CLOCK_LOW | member | = 'clock_low' | |
OUTPUT_LOW | member | = 'output_low' | |
EDGE_CLOCK_HIGH | member | = 'edge_clock_high' | |
NON_LOGIC | member | = 'non_logic' |
PropertyId
enumfrom kicad_monkey import PropertyId
enum PropertyId
Standard KiCad property ID numbers (ordinals).
KiCad assigns fixed ordinal numbers to standard properties.
User-defined properties start at 5 and increment.
Members (6)
| Member | Kind | Signature | Summary |
|---|---|---|---|
REFERENCE | member | = 0 | |
VALUE | member | = 1 | |
FOOTPRINT | member | = 2 | |
DATASHEET | member | = 3 | |
DESCRIPTION | member | = 4 | |
USER_START | member | = 5 |
StandardPropertyKey
enumfrom kicad_monkey import StandardPropertyKey
enum StandardPropertyKey
Standard KiCad schematic/symbol property keys.
Members (5)
| Member | Kind | Signature | Summary |
|---|---|---|---|
REFERENCE | member | = 'Reference' | |
VALUE | member | = 'Value' | |
FOOTPRINT | member | = 'Footprint' | |
DATASHEET | member | = 'Datasheet' | |
DESCRIPTION | member | = 'Description' |
StandardSheetPropertyKey
enumfrom kicad_monkey import StandardSheetPropertyKey
enum StandardSheetPropertyKey
Standard hierarchical sheet property keys.
Members (4)
| Member | Kind | Signature | Summary |
|---|---|---|---|
SHEET_NAME | member | = 'Sheetname' | |
SHEET_FILE | member | = 'Sheetfile' | |
LEGACY_SHEET_NAME | member | = 'Sheet name' | |
LEGACY_SHEET_FILE | member | = 'Sheet file' |