Schematic¶
Schematics in KiCad can be composed of one or many different sheets, each with a unique sheet path
that identifies it. The Schematic class can represent an entire
schematic or a view onto a single sheet. Many of its methods can take an optional sheet path
parameter to filter to a particular path.
Schematics produce graphical outputs but also connectivity data (called a netlist). KiCad uses graphical position to establish connectivity: each connectable object (for example, a symbol pin, wire segment, or label) has one or more connection points. Each connection point is a position on the graphical canvas, and items must exactly match in position to be considered connected. For this reason, it is standard to use a 50 mil (1.27mm) layout grid for placing all connected items in a schematic. The KiCad GUI has some safeguards to prevent accidentally placing items in a way that they are close but not quite connected, but API clients need to do this themselves.
- class Schematic(kicad: KiCadClient, document: DocumentSpecifier)¶
A representation of the schematic of a KiCad project, or a view into a subsheet of that schematic. This class is the main entrypoint to interacting with or creating schematics with the API. Schematics in a project may be split across many different sheets; each sheet is its own graphical canvas and has a unique
SheetPath. Useget_hierarchy()to get the sheets in a project, andfor_sheet()to get a version of this schematic object scoped to a particular sheet. The sheet scope determines whether the result of queries likeget_items()covers the entire schematic or just one sheet.Added in version 0.x.y: (KiCad 11)
- property client: KiCadClient¶
- property document: DocumentSpecifier¶
- export_bom(output_file: str, field_settings: ~kipy.schematic_jobs.BOMFieldSettings, format_settings: ~kipy.schematic_jobs.BOMFormatSettings = <kipy.schematic_jobs.BOMFormatSettings object>, exclude_dnp: bool = False, group_symbols: bool = False, variant_name: str = '') JobResult¶
Exports the schematic bill of materials (BOM) to a single output file.
- Parameters:
output_file – Sets the filename of the export. Relative paths are resolved from the project directory.
field_settings – Controls which symbol fields to export (see
BOMFieldSettings)format_settings – Controls the format of the BOM (see
BOMFormatSettings); defaults toBOM_FORMAT_CSV(KiCad’s built-in CSV preset)exclude_dnp – Excludes symbols marked as do not populate (DNP) from the BOM.
group_symbols – Groups symbols together into a single BOM row when their fields match one of the
BOMFieldwheregroup_byis True.
- export_dxf(output_path: str, plot_settings: PlotSettings | None = None, sheet_mode: int = 0) JobResult¶
Plots the schematic to DXF.
- Parameters:
output_path – Sets the directory or filename of the export. Relative paths are resolved from the project directory.
plot_settings – Controls the general shared schematic plot settings
sheet_mode – Set to
SJSM_ALL_SHEETS,output_pathis taken as a directory and one file per sheet is created. Otherwise, the sheet pointed to by this schematic object is plotted to the file given byoutput_path.
- export_netlist(output_file: str, format: int = 2, variant_name: str = '') JobResult¶
Exports the schematic netlist to a single output file.
- Parameters:
output_file – Sets the filename of the export. Relative paths are resolved from the project directory.
format – Sets the netlist format to use for the export.
variant_name – If non-empty, selects a schematic variant to generate the netlist for; uses the default variant otherwise.
- export_pdf(output_file: str, plot_settings: PlotSettings | None = None, property_popups: bool = False, hierarchical_links: bool = False, include_metadata: bool = True) JobResult¶
Plots the schematic to a single PDF file.
- Parameters:
output_file – Sets the filename of the export. Relative paths are resolved from the project directory.
plot_settings – Controls the general shared schematic plot settings
property_popups – Controls whether popup menus with object properties should be generated in the PDF.
hierarchical_links – Controls whether hierarchical labels should be generated as hyperlinkst to other sheets in the PDF.
include_metadata – When enabled, the generated PDF will include document properties from the AUTHOR and SUBJECT text variables.
- export_png(output_path: str, plot_settings: PlotSettings | None = None, dpi: int | None = None, antialiasing: int = 2, sheet_mode: int = 1) JobResult¶
Plots the schematic to PNG.
- Parameters:
output_path – Sets the directory or filename of the export. Relative paths are resolved from the project directory.
plot_settings – Controls the general shared schematic plot settings
dpi – Sets the resolution of the generated image. When omitted, the default of 300 is used. KiCad accepts between 72 and 2400 DPI.
antialiasing – Controls whether the output image is anti-aliased (enabled by default)
sheet_mode – Set to
SJSM_ALL_SHEETS,output_pathis taken as a directory and one file per sheet is created. Otherwise, the sheet pointed to by this schematic object is plotted to the file given byoutput_path.
- export_ps(output_path: str, plot_settings: PlotSettings | None = None, sheet_mode: int = 1) JobResult¶
Plots the schematic to PostScript.
- Parameters:
output_path – Sets the directory or filename of the export. Relative paths are resolved from the project directory.
plot_settings – Controls the general shared schematic plot settings
sheet_mode – Set to
SJSM_ALL_SHEETS,output_pathis taken as a directory and one file per sheet is created. Otherwise, the sheet pointed to by this schematic object is plotted to the file given byoutput_path.
- export_svg(output_path: str, plot_settings: PlotSettings | None = None, sheet_mode: int = 0) JobResult¶
Plots the schematic to SVG.
- Parameters:
output_path – Sets the directory or filename of the export. Relative paths are resolved from the project directory.
plot_settings – Controls the general shared schematic plot settings
sheet_mode – Set to
SJSM_ALL_SHEETS,output_pathis taken as a directory and one file per sheet is created. Otherwise, the sheet pointed to by this schematic object is plotted to the file given byoutput_path.
- for_sheet(sheet: SheetInstance | SheetPath) Schematic¶
Returns a Schematic bound to the given sheet, e.g. one from
get_hierarchy()or one of its children.The returned object can be used to make calls (
get_items(), etc) on a subsheet.
- get_bus_entries(sheet_path: SheetPath | SheetInstance | None = None) Sequence[BusEntry]¶
Returns all wire-to-bus and bus-to-bus entries in the schematic
- get_groups(sheet_path: SheetPath | SheetInstance | None = None) Sequence[Group]¶
- get_hierarchy() SchematicHierarchy¶
Retrieves the sheet hierarchy of the schematic.
The returned object provides access to the root sheet (
root), and can be iterated directly to walk every sheet in the hierarchy depth-first.
- get_images(sheet_path: SheetPath | SheetInstance | None = None) Sequence[SchematicImage]¶
- get_items(types: int | Sequence[int] | None = None, sheet_path: SheetPath | SheetInstance | None = None) Sequence[SchematicItem]¶
Retrieves items from the schematic, optionally filtered to a single or set of types and/or to a single sheet.
- Parameters:
types – Optional type or types of items to retrieve.
sheet_path – Optional sheet to scope the query to. If not provided, items from the sheet this Schematic is bound to are returned, or from all sheets in the schematic if this Schematic is not bound to a sheet (see
for_sheet()).
- get_junctions(sheet_path: SheetPath | SheetInstance | None = None) Sequence[Junction]¶
Returns all junctions in the schematic
- get_labels(sheet_path: SheetPath | SheetInstance | None = None) Sequence[LocalLabel | GlobalLabel | HierarchicalLabel | DirectiveLabel]¶
- get_lines(sheet_path: SheetPath | SheetInstance | None = None) Sequence[SchematicLine]¶
- get_netlist(types: int | Sequence[int] | None = None) list[SchematicNet]¶
- get_no_connects(sheet_path: SheetPath | SheetInstance | None = None) Sequence[NoConnectMarker]¶
Returns all no-connect markers in the schematic
- get_page_settings() PageSettings¶
- get_rule_areas(sheet_path: SheetPath | SheetInstance | None = None) Sequence[SchematicRuleArea]¶
Returns all rule areas (schematic keepouts) in the schematic
- get_shapes(sheet_path: SheetPath | SheetInstance | None = None) Sequence[SchematicGraphicShape]¶
- get_sheet_symbols(sheet_path: SheetPath | SheetInstance | None = None) Sequence[SheetSymbol]¶
- get_symbols(sheet_path: SheetPath | SheetInstance | None = None) Sequence[SchematicSymbolInstance]¶
- get_tables(sheet_path: SheetPath | SheetInstance | None = None) Sequence[SchematicTable]¶
- get_text(sheet_path: SheetPath | SheetInstance | None = None) Sequence[SchematicText | SchematicTextBox]¶
- get_title_block() TitleBlockInfo¶
- hit_test(item: SchematicItem, position: Vector2, tolerance: int = 0) bool¶
Performs a hit test on a schematic item at a given position.
- iter_sheets()¶
Iterates over all sheets in the schematic’s hierarchy, depth-first, beginning with the root sheet.
- property name: str¶
- place_symbol_from_library(lib_id: LibraryIdentifier | str, position: Vector2, orientation: int | None = None, unit: int | None = None, reference: str | None = None, sheet_path: SheetPath | SheetInstance | None = None) SchematicSymbolInstance¶
Places a symbol from a library onto the schematic.
Requires that libraries be loaded, which will not be the case in headless mode until
load_all_libraries()has been called.If
referenceis not given, KiCad will either leave the symbol unannotated or automatically annotate it depending on the user’s current auto-annotation preference.- Parameters:
lib_id – The symbol to place, either as a
LibraryIdentifieror a string such as"Device:R".position – The position to place the symbol at.
orientation – Optional orientation;
SchematicSymbolOrientation.SSO_0if not given.unit – Optional unit number for multi-unit symbols; places the first unit if not given.
reference – Optional reference designator to assign to the new symbol. KiCad currently requires that references be in the format <prefix><number> and automatically appends a letter for multi-unit symbols. Reference designators must be unique within a schematic for a valid netlist to be generated. Assigning a non-unique reference or one that does not meet KiCad’s requirements will be accepted by the API but will result in a schematic that cannot be used to drive a board until the annotation is fixed.
sheet_path – Optional sheet to place the symbol on; uses the sheet this Schematic is bound to if not given (falling back to the sheet currently active in KiCad if this object is not bound to a sheet). Use
for_sheet()or pass an explicitsheet_pathto place symbols on a subsheet if this object holds the root sheet.
- Returns:
The newly-placed symbol instance.
Added in version 0.x.y: (KiCad 11)
- set_page_settings(page_settings: PageSettings) PageSettings¶
- set_title_block(title_block: TitleBlockInfo)¶
Schematic Types¶
These objects can be placed on a schematic (and some can also exist inside a schematic symbol).
- class AssociatedFootprint(proto: AssociatedFootprint | None = None, proto_ref: AssociatedFootprint | None = None)¶
A footprint the symbol is associated with, and the name of the pin map to use for it
- property footprint: LibraryIdentifier¶
- property map_name: str¶
- class BaseLabel(proto: Message | None = None, proto_ref: Message | None = None)¶
The base class for schematic labels. Labels are special text items that give names to electrical nets on a schematic. They form connections at their
positionto other connected items (such as wires or pins).The orientation of a label is controlled by
spin_style, not bytext.attributes.angle: KiCad derives both the text angle and the horizontal justification from the spin style, and an angle set viatext.attributes.angleis overwritten by the spin style when the label is unpacked by KiCad. For example,SLSS_UPrenders the text vertically with its start anchored at the label position, whileSLSS_RIGHTrenders it horizontally with the text extending away from the anchor according to the justification.Added in version 0.x.y: (KiCad 11)
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the label
- property fields: Sequence[SchematicField]¶
- property fields_autoplaced: bool¶
- property locked: bool¶
- property spin_style: int¶
- property text: Text¶
The label text. Setting
attributes.angleon this text raisesAttributeError; usespin_styleto control label orientation
- class BusEntry(proto: BusEntry | None = None, proto_ref: BusEntry | None = None)¶
A bus entry is a short diagonal wire segment that attaches a wire to a bus.
Added in version 0.x.y: (KiCad 11)
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the bus entry
- property locked: bool¶
- property stroke: StrokeAttributes¶
- property type: int¶
- class DirectiveLabel(proto: DirectiveLabel | None = None, proto_ref: DirectiveLabel | None = None)¶
Directive labels are special labels that apply specific design rules to items rather than applying a net name. They can also be used to apply rules to many items by creating a
SchematicRuleAreaand placing aDirectiveLabelon its border. All items enclosed by or intersecting the border of the rule area will have the same directives applied.Added in version 0.x.y: (KiCad 11)
- class GlobalLabel(proto: GlobalLabel | None = None, proto_ref: GlobalLabel | None = None)¶
Global labels are single-line text labels with a graphical border. They create global labels with no sheet-specific prefix (such as
NET1).Added in version 0.x.y: (KiCad 11)
- property intersheet_refs_field: SchematicField¶
- class Group(proto: Group | None = None, proto_ref: Group | None = None)¶
Represents a group of items on a schematic.
Groups store item membership by ID only. See the documentation for
itemsanditem_idsfor details.Added in version 0.x.y: (KiCad 11)
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the group
- property item_ids: Sequence[KIID]¶
The IDs of the group members
- property items: Sequence[SchematicItem]¶
The members of the group, lazily resolved into actual item wrappers.
Accessing this property will cause API traffic to resolve the items by their KIID from the document.
Note that the group does not own these items;
item_idsis the actual way that group membership is tracked. This means that you cannot just add items to a group and then to a document by setting thisitemsproperty, you also need to add the items to the document separately.
- property locked: bool¶
- property name: str¶
- class HierarchicalLabel(proto: HierarchicalLabel | None = None, proto_ref: HierarchicalLabel | None = None)¶
Hierarchical labels are special local labels that include a hierarchical port symbol and match up with a hierarchical sheet pin on the sheet symbol one level up in the hierarchy. They indicate a net that is exposed as a sheet pin for connection elsewhere in a hierarchical schematic. See also
SheetPin.Added in version 0.x.y: (KiCad 11)
- class JumperGroup(proto: JumperGroup | None = None, proto_ref: JumperGroup | None = None)¶
A group of pins internally connected by a jumper
- property pin_numbers: Sequence[str]¶
- class JumperSettings(proto: JumperSettings | None = None, proto_ref: JumperSettings | None = None)¶
Jumper definitions for a symbol
- property duplicate_names_are_jumpered: bool¶
True if pins with duplicate names are considered connected by a jumper
- property groups: Sequence[JumperGroup]¶
- class Junction(proto: Junction | None = None, proto_ref: Junction | None = None)¶
A junction is a circular symbol that indicates the intersection of 3 or more wire endpoints. Note: junctions in KiCad are computed dynamically based on line intersections.
Added in version 0.x.y: (KiCad 11)
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the junction
- property diameter: int¶
- property locked: bool¶
- class LabelText(proto: Text | None = None, proto_ref: Text | None = None)¶
A
Textthat rejects angle assignment, because KiCad derives label orientation from the label’s spin style rather than from the text angle- property attributes: TextAttributes¶
- class LocalLabel(proto: LocalLabel | None = None, proto_ref: LocalLabel | None = None)¶
Local labels are single-line text labels with no extra graphical decoration. They create sheet-specific net labels (such as /NET1 or /Subsheet/NET2).
Added in version 0.x.y: (KiCad 11)
- class NoConnectMarker(proto: NoConnectMarker | None = None, proto_ref: NoConnectMarker | None = None)¶
A no-connect marker is a X-shaped symbol that can be placed on a wire or pin, and marks the net it is attached to as intentionally isolated.
Added in version 0.x.y: (KiCad 11)
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the no-connect marker
- property locked: bool¶
- property size: int¶
- class PinMap(proto: PinMap | None = None, proto_ref: PinMap | None = None)¶
A named mapping of symbol pins to footprint pads
- property entries: Sequence[PinMapEntry]¶
- property name: str¶
- class PinMapEntry(proto: PinMapEntry | None = None, proto_ref: PinMapEntry | None = None)¶
Maps a symbol pin to a footprint pad
- property pad_number: str¶
bracketed stacked list allowed, e.g. ‘[4,9]’
- property pin_number: str¶
- class PinMapInstanceOverride(proto: PinMapInstanceOverride | None = None, proto_ref: PinMapInstanceOverride | None = None)¶
A per-symbol-instance override of the library pin maps
- property active_map_name: str¶
- property edits: Sequence[PinMapEntry]¶
- property mode: int¶
- class SchematicBodyStyle(proto: SchematicBodyStyle | None = None, proto_ref: SchematicBodyStyle | None = None)¶
A named body style a symbol can be displayed with
- property name: str¶
- class SchematicField(proto: SchematicField | None = None, proto_ref: SchematicField | None = None)¶
A field is a text item attached to another item that holds a name and value. Some items (such as symbols) have mandatory fields that always exist, and other items (such as labels) don’t have any fields by default but may have custom fields attached.
Added in version 0.x.y: (KiCad 11)
- property allow_auto_place: bool¶
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the field
- property is_private: bool¶
- property name: str¶
- property show_name: bool¶
- property visible: bool¶
- class SchematicGraphicShape(proto: SchematicGraphicShape | None = None, proto_ref: SchematicGraphicShape | None = None)¶
Represents a graphic shape on a schematic.
Although the underlying GraphicShape classes are shared between board and schematic in this API, there are some important differences:
Segmentshapes are not supported in the schematic editor. To draw a two-point line segment, either create aSchematicLineobject, or create aPolygonshape with only two points.Polygonshapes are more limited than in the board editor. The schematic editor supports a single polyline, and it does not use the explicitPolyLine.closedflag inPolygonWithHoles.outline. To create a closed polygon, duplicate the starting point as the last point.
Added in version 0.x.y: (KiCad 11)
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the shape
- property locked: bool¶
- property shape: GraphicShape | None¶
- class SchematicHierarchy(top_level_sheets: Sequence[SheetInstance])¶
The sheet hierarchy of a schematic, returned from
kipy.schematic.Schematic.get_hierarchy().rootprovides the first top-level sheet of the schematic, and iterating the hierarchy yields every sheet depth-first, beginning with the root.Added in version 0.x.y: (KiCad 11)
- property root: SheetInstance¶
The root sheet of the schematic
- property top_level_sheets: Sequence[SheetInstance]¶
All top-level sheets of the schematic. This is the root sheet, plus any additional sheets in multi-root hierarchies.
- class SchematicImage(proto: SchematicImage | None = None, proto_ref: SchematicImage | None = None)¶
A bitmap image placed on a schematic.
Added in version 0.x.y: (KiCad 11)
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the image
- property image_data: bytes¶
- property image_scale: float¶
- property locked: bool¶
- class SchematicItem(proto: Message | None = None, proto_ref: Message | None = None)¶
- property id: KIID¶
- class SchematicLine(proto: SchematicLine | None = None, proto_ref: SchematicLine | None = None)¶
A line segment on a schematic, which may be a net or bus wire or a graphic line (see
type). Wires and buses form electrical connections to each other and to pins at their endpoints. KiCad automatically cleans up wires (whether added in the GUI or by the API) to remove overlapping wire segments and split wire segments at intersections with other wire endpoints or pins. Wires can form connections with labels anywhere along their length.Added in version 0.x.y: (KiCad 11)
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the line
- property end_ending: LineEnding | None¶
- property locked: bool¶
- property start_ending: LineEnding | None¶
- property stroke: StrokeAttributes¶
- property type: int¶
- class SchematicNet(proto: SchematicNet | None = None, proto_ref: SchematicNet | None = None)¶
Data returned from e.g. GetSchematicNetlist (read-only)
Added in version 0.x.y: (KiCad 11)
- property name: str¶
- property sheets: Sequence[SchematicNetSheetContents]¶
- class SchematicNetSheetContents(proto: SchematicNetSheetContents | None = None, proto_ref: SchematicNetSheetContents | None = None)¶
Data returned from GetSchematicNetlist (read-only)
Added in version 0.x.y: (KiCad 11)
- property items: list[KIID]¶
- class SchematicPin(proto: SchematicPin | None = None, proto_ref: SchematicPin | None = None)¶
A symbol pin. Pins form electrical connection at their
positionand then extend back to the symbol body by theirlength. Pins map to footprint pads according to theirnumberproperty, which, despite the name, does not need to be strictly numeric.Added in version 0.x.y: (KiCad 11)
- property active_alternate: str | None¶
- property alternates: Sequence[SchematicPinAlternate]¶
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the pin
- property electrical_type: int¶
- property length: int¶
- property name: str¶
A functional name for the pin, for example ‘VCC’.
- property name_text_size: int¶
- property number: str¶
The identifier for this pin which maps it to a footprint pad. May be alphanumeric.
- property number_text_size: int¶
- property orientation: int¶
Which way the pin is oriented, relative to the connection point (
position).For example,
SPO_RIGHTmeans the pin shape extends rightward from the connection point, which usually means the pin is placed on the left side of a symbol.
- property position: Vector2¶
Position in the symbol definition’s local coordinate frame (relative to the symbol origin, without any rotation or mirroring applied)
- property shape: int¶
- property visible: bool¶
- class SchematicPinAlternate(proto: SchematicPinAlternate | None = None, proto_ref: SchematicPinAlternate | None = None)¶
An alternate definition for a
SchematicPin. Pins may have multiple different functions defined using alternates, and these will show as user-selectable when the symbol is placed on a schematic. Alternates may change the name, shape, and electrical function of a pin, but not the number (since that is the true identity of a pin and how it maps to a footprint pad).Added in version 0.x.y: (KiCad 11)
- property electrical_type: int¶
- property name: str¶
- property shape: int¶
- class SchematicRuleArea(proto: SchematicRuleArea | None = None, proto_ref: SchematicRuleArea | None = None)¶
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the rule area
- property dnp: bool¶
- property exclude_from_board: bool¶
- property exclude_from_bom: bool¶
- property exclude_from_sim: bool¶
- property locked: bool¶
- property shape: GraphicShape | None¶
The rule area outline (only polygons are supported by KiCad)
- class SchematicSymbol(proto: SchematicSymbol | None = None, proto_ref: SchematicSymbol | None = None)¶
A symbol definition, or a library symbol.
Child items (pins, graphics, text, fields) are stored with positions relative to the symbol origin and without any rotation or mirroring applied.
Added in version 0.x.y: (KiCad 11)
- add_item(item: SchematicSymbolChild | SchematicPin | SchematicField | SchematicGraphicShape | SchematicText | SchematicTextBox, unit: int | None = None, is_private: bool = False)¶
Adds an item to the symbol definition.
Accepts a
SchematicSymbolChildor a concrete child item (aSchematicPin,SchematicField,SchematicGraphicShape,SchematicText, orSchematicTextBox); concrete items are wrapped in aSchematicSymbolChildautomatically.- Parameters:
unit – if given, the item belongs only to this unit of a multi-unit symbol; otherwise it is common to all units.
is_private – if true, the item is shown only in the symbol editor, not on the schematic.
- property attributes: SchematicSymbolAttributes¶
- property body_style: Sequence[SchematicBodyStyle]¶
Body styles the symbol can be displayed with
- property body_style_count: int¶
- property datasheet_field: SchematicField¶
- property description_field: SchematicField¶
- property embedded_fonts: bool¶
- property fields: Sequence[SchematicField]¶
The definition’s fields
- property footprint_field: SchematicField¶
- property footprint_filters: Sequence[str]¶
- property id: LibraryIdentifier¶
- property items: Sequence[SchematicSymbolChild]¶
- property jumpers: JumperSettings¶
Jumper settings for the symbol
- property keywords: str¶
- property pin_maps: SymbolPinMaps¶
Pin maps and their associated footprints
- property pin_name_offset: int¶
Distance between the pin and its name text; 0 means the name is inside the body outline
- property pins: Sequence[SchematicPin]¶
The symbol’s pins.
Includes pins from units that are not placed in the instance this symbol belongs to(for multi-unit symbols).
- property proto¶
- property reference_field: SchematicField¶
- property show_pin_names: bool¶
Whether pin names are shown for all pins of this symbol
- property show_pin_numbers: bool¶
Whether pin numbers are shown for all pins of this symbol
- property type: int¶
The type of the symbol (normal, local power, or global power).
A power symbol is one that drives a net name from a single hidden power input pin. To create a normal power symbol, set
typetoSchematicSymbolType.SST_GLOBAL_POWERand add a single hidden pin of typeElectricalPinType.EPT_POWER_INPUT, normally with length 0. The power symbol will drive a net according to itsvalue_fieldcontents. A local power symbol (SchematicSymbolType.SST_LOCAL_POWER) will act like a local label on the sheet it is placed on rather than a global label.
- property unit_count: int¶
- property unit_display_names: Sequence[SchematicUnitDisplayName]¶
- property units_locked: bool¶
- property value_field: SchematicField¶
- class SchematicSymbolAttributes(proto: SchematicSymbolAttributes | None = None, proto_ref: SchematicSymbolAttributes | None = None)¶
Added in version 0.x.y: (KiCad 11)
- property do_not_populate: bool¶
- property exclude_from_bill_of_materials: bool¶
- property exclude_from_board: bool¶
- property exclude_from_position_files: bool¶
- property exclude_from_simulation: bool¶
- class SchematicSymbolChild(proto: SchematicSymbolChild | None = None, proto_ref: SchematicSymbolChild | None = None)¶
An item stored in a symbol definition (a pin, field, graphic shape, text, or text box).
Pass a concrete item to
SchematicSymbol.add_item()rather than constructing this class directly; the child wrapper and its unit/body-style tags are created for you. Child item positions are relative to the symbol origin, without rotation or mirroring.Added in version 0.x.y: (KiCad 11)
- property is_private: bool¶
Private items are only shown in the symbol editor, not the schematic
- property item: SchematicPin | SchematicField | SchematicGraphicShape | SchematicText | SchematicTextBox | Any¶
The child’s item, unpacked into a concrete wrapper when possible
- property kind: str | None¶
The type of the packed item, if valid
- property unit: int | None¶
- class SchematicSymbolInstance(proto: SchematicSymbolInstance | None = None, proto_ref: SchematicSymbolInstance | None = None)¶
An instance of a symbol placed on a schematic.
Direct children of the instance (for example, fields) are stored in absolute coordinate space, meaning they are relative to a sheet. Children of the
SchematicSymboldefinition are in relative coordinate space and don’t have rotation or mirroring applied.Added in version 0.x.y: (KiCad 11)
- property attributes: SchematicSymbolAttributes¶
The attributes of the default variant, shared by every instance of this symbol. Give one instance its own attributes through a named variant instead.
- property body_style: int | None¶
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the symbol instance
- property datasheet_field: SchematicField¶
- property definition: SchematicSymbol¶
- property description_field: SchematicField¶
- property fields_autoplaced: bool¶
- property footprint_field: SchematicField¶
- property locked: bool¶
- property passthrough: int¶
- property path: SheetPath¶
Symbol instances may refer to the same graphical symbol from multiple different sheets in a hierarchical schematic. Each instance will have its own reference designator, and may also have a different selected unit and other attributes.
On a create or update request, the targeted sheet comes from the request header, and this field reports the sheet the returned instance was read from.
- property pin_map_override: PinMapInstanceOverride¶
- property pin_name_offset: int¶
- property proto¶
- property reference: str¶
The symbol’s reference designator (a shortcut for self.reference_field.text.value)
- property reference_field: SchematicField¶
- property show_pin_names: bool¶
- property show_pin_numbers: bool¶
- property transform: SchematicSymbolTransform¶
- property unit: int¶
- property user_fields: Sequence[SchematicField]¶
- property value: str¶
The symbol’s value (a shortcut for self.value_field.text.value)
- property value_field: SchematicField¶
- property variants: Sequence[SchematicSymbolVariant]¶
- class SchematicSymbolTransform(proto: SchematicSymbolTransform | None = None, proto_ref: SchematicSymbolTransform | None = None)¶
Added in version 0.x.y: (KiCad 11)
- property mirror_x: bool¶
- property mirror_y: bool¶
- property orientation: int¶
- class SchematicSymbolVariant(proto: SchematicSymbolVariant | None = None, proto_ref: SchematicSymbolVariant | None = None)¶
Added in version 0.x.y: (KiCad 11)
- property attributes: SchematicSymbolAttributes¶
complete set of attributes for a symbol with this variant
- property description: str¶
- property fields: dict[str, str]¶
- property name: str¶
- property pin_map_override: PinMapInstanceOverride | None¶
Per-variant pin-to-pad map override, if any
- property symbol_override: LibraryIdentifier | None¶
Alternate library symbol used in this variant, if any
- class SchematicTable(proto: SchematicTable | None = None, proto_ref: SchematicTable | None = None)¶
A table in a schematic
- property border_stroke: StrokeAttributes¶
- property cells: Sequence[SchematicTableCell]¶
- property column_count: int¶
- property column_separators: int¶
- property column_widths: Sequence[int]¶
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the table
- property external_border: int¶
- property header_separator: int¶
- property locked: bool¶
- property row_heights: Sequence[int]¶
- property row_separators: int¶
- property separators_stroke: StrokeAttributes¶
- class SchematicTableCell(proto: SchematicTableCell | None = None, proto_ref: SchematicTableCell | None = None)¶
A single cell of a schematic table
- property column_span: int¶
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the cell
- property row_span: int¶
- property text_box: SchematicTextBox¶
- class SchematicText(proto: SchematicText | None = None, proto_ref: SchematicText | None = None)¶
A single-line text item. Text items are used for notes and other annotations. They do not impact the netlist.
Added in version 0.x.y: (KiCad 11)
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the text
- property exclude_from_sim: bool¶
- property locked: bool¶
- property value: str¶
- class SchematicTextBox(proto: SchematicTextBox | None = None, proto_ref: SchematicTextBox | None = None)¶
A multi-line text item with optional border. Text items are used for notes and other annotations. They do not impact the netlist.
Added in version 0.x.y: (KiCad 11)
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the text box
- property exclude_from_sim: bool¶
- property graphic_attributes: GraphicAttributes¶
- property locked: bool¶
- property margin_bottom: int¶
- property margin_left: int¶
- property margin_right: int¶
- property margin_top: int¶
- property value: str¶
- class SchematicUnitDisplayName(proto: SchematicUnitDisplayName | None = None, proto_ref: SchematicUnitDisplayName | None = None)¶
A custom display name for one unit of a multi-unit symbol
- property name: str¶
- property unit: int¶
- class ShapeLabel(proto: Message | None = None, proto_ref: Message | None = None)¶
A
BaseLabelthat can take on a graphical shapeAdded in version 0.x.y: (KiCad 11)
- property shape: int¶
- class SheetInstance(proto: SheetInstance | None = None, proto_ref: SheetInstance | None = None)¶
Data returned from e.g. GetSchematicHierarchy (read-only)
Added in version 0.x.y: (KiCad 11)
- property children: Sequence[SheetInstance]¶
- property filename: str¶
- property name: str¶
- property page_number: str¶
- class SheetPin(proto: SheetPin | None = None, proto_ref: SheetPin | None = None)¶
A pin on a hierarchical sheet symbol (
SheetSymbol) that is paired with a hierarchical label on the subsheet (seeHierarchicalLabel).Added in version 0.x.y: (KiCad 11)
- property side: int¶
- class SheetSymbol(proto: SheetSymbol | None = None, proto_ref: SheetSymbol | None = None)¶
The graphical representation of a hierarchical sub-sheet on its parent sheet. A sheet symbol contains the metadata about the sub-sheet such as its filename and instance name, as well as its pins and other graphic attributes. Sheet symbols may also have custom fields.
Added in version 0.x.y: (KiCad 11)
- property border_stroke: StrokeAttributes¶
- property custom_properties: Sequence[CustomProperty]¶
User-defined properties attached to the sheet
- property dnp: bool¶
- property exclude_from_board: bool¶
- property exclude_from_bom: bool¶
- property exclude_from_sim: bool¶
- property fields_autoplaced: bool¶
- property filename_field: SchematicField¶
- property fill: GraphicFillAttributes¶
- property locked: bool¶
- property name_field: SchematicField¶
- property page_number: str¶
Page numbers in KiCad are arbitrary user data and don’t have to be numeric
- property path: SheetPath¶
The sheet that contains this instance.
On a create or update request, the targeted sheet comes from the request header, and this field reports the sheet the returned instance was read from.
- property user_fields: Sequence[SchematicField]¶
- property variants: Sequence[SheetVariant]¶
The variants carried by this instance.
- class SheetVariant(proto: SheetVariant | None = None, proto_ref: SheetVariant | None = None)¶
One sheet variant and its per-variant field values
- property description: str | None¶
- property dnp: bool | None¶
- property exclude_from_bom: bool | None¶
- property exclude_from_sim: bool | None¶
- property fields: dict[str, str]¶
Per-variant overrides of field values, keyed by field name
- property name: str¶
- class SheetVariants(proto: SheetVariants | None = None, proto_ref: SheetVariants | None = None)¶
- property variants: Sequence[SheetVariant]¶
- class SymbolPinMaps(proto: SymbolPinMaps | None = None, proto_ref: SymbolPinMaps | None = None)¶
Pin maps defined in a symbol and the footprints they are associated with
- property associated_footprints: Sequence[AssociatedFootprint]¶
- unwrap(message: Any) Wrapper¶
Schematic Jobs¶
Classes related to schematic output jobs (file exports)
- class BOMField(proto: BOMField | None = None, proto_ref: BOMField | None = None)¶
One exported field column definition for schematic BOM jobs.
- property group_by: bool¶
Whether or not to group exported components by this field
- property label: str¶
The name to give the field in the exported BOM (i.e. the column header name)
- property name: str¶
The name of the field in KiCad to export
- class BOMFieldSettings(proto: BOMFieldSettings | None = None, proto_ref: BOMFieldSettings | None = None)¶
Field-selection settings for schematic BOM export jobs.
- property filter: str¶
- property filter_scope: int¶
Fields searched by the filter; defaults to reference designators if unspecified.
- property preset_name: str¶
If supplied, will apply a default or user-stored preset to the other field settings. Default values available include ‘Default Editing’, ‘Grouped By Value’, ‘Grouped By Value and Footprint’, and ‘Attributes’.
- property sort_direction: int¶
Sort direction; defaults to ascending if unspecified
- property sort_field: str¶
- class BOMFormatSettings(proto: BOMFormatSettings | None = None, proto_ref: BOMFormatSettings | None = None)¶
Formatting settings for schematic BOM export jobs.
- property field_delimiter: str¶
Delimiter between fields (columns) in a data row
- property include_byte_order_mark: bool¶
Whether to include a UTF-8 byte order mark at the start of the exported file.
- property keep_line_breaks: bool¶
Whether line breaks in field values will be preserved when exporting or stripped
- property keep_tabs: bool¶
Whether tab characters in field values will be preserved when exporting or stripped
- property preset_name: str¶
If supplied, will apply a preset to the other format settings. Built-in values ‘CSV’, ‘TSV’, and ‘Semicolons’ are always available, as well as any user-saved presets.
- property ref_delimiter: str¶
Delimiter between reference designators when exporting a list (e.g. “R1,R3,R5”)
- property ref_range_delimiter: str¶
Delimiter between reference designators when exporting a range (e.g. “R1-R10”)
- property string_delimiter: str¶
Character to use for quoting strings
- class JobResult(proto: RunJobResponse | None = None, proto_ref: RunJobResponse | None = None)¶
A result returned from running an export job. Provides overall status and a list of files created by the job.
- property message: str¶
Optional message containing warning or error details. Should be empty if status is
JS_SUCCESS.
- property output_paths: list[str]¶
- property status: int¶
- property succeeded: bool¶
- class PlotSettings(proto: SchematicPlotSettings | None = None, proto_ref: SchematicPlotSettings | None = None)¶
Shared settings for schematic plotting jobs.
Set
plot_allto plot every sheet. When it is set,plot_pagesfilters the plotted sheets by page number (e.g."2"). Whenplot_allis not set,plot_pagesis ignored and only the current sheet (or sheet targeted by the document, if one is provided).- property black_and_white: bool¶
- property default_font: str¶
- property drawing_sheet: str¶
- property min_pen_width: int¶
- property page_size: int¶
- property plot_all: bool¶
- property plot_drawing_sheet: bool¶
- property plot_pages: list[str]¶
- property sheet_mode: int¶
Selects directory (all sheets) or single-file (one sheet) output semantics.
- property show_hop_over: bool¶
- property theme: str¶
- property use_background_color: bool¶
- property variant: str¶