Schematic
Dataclasses describing the contents of .kicad_sch files.
- class edea.kicad.schematic.__init__.PinAssignment(number: Annotated[str, ('kicad_no_kw', 'kicad_always_quotes')], uuid: uuid.UUID = <factory>, alternate: Optional[str] = None)
Bases:
KicadSchExpr
- class edea.kicad.schematic.__init__.DefaultInstance(reference: str, unit: int = 1, value: str = '', footprint: str = '')
Bases:
KicadSchExpr
Default component instance associated with the symbol.
- Parameters:
reference – Reference designator for the component.
unit – Which unit in the symbol library definition that the schematic symbol represents.
value – The component value.
footprint – The footprint associated with the component.
- class edea.kicad.schematic.__init__.SymbolUseInstancePath(name: str, reference: str, unit: int)
Bases:
KicadSchExpr
A path between components within a KiCad schematic project.
- Parameters:
name – Reference designator for the component in the path.
reference – Reference designator for the starting point of the path.
unit – Which unit in the symbol library definition that the schematic symbol represents..
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for “path” element.
- class edea.kicad.schematic.__init__.SymbolUseInstanceProject(name: str, paths: list[~edea.kicad.schematic.__init__.SymbolUseInstancePath] = <factory>)
Bases:
KicadSchExpr
A symbol usage information for a specific project within a KiCad schematic.
- Parameters:
name – The project name where the symbol is used.
paths – A list of
SymbolUseInstancePath
objects defining connections within the project.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for for this element (“project”).
- paths: list[SymbolUseInstancePath]
- class edea.kicad.schematic.__init__.SymbolUseInstances(projects: list[~edea.kicad.schematic.__init__.SymbolUseInstanceProject] = <factory>)
Bases:
KicadSchExpr
A symbol usage information across different projects within a KiCad schematic.
- Parameters:
projects – A list of
SymbolUseInstanceProject
objects defining symbol usage details for each project.- Variables:
kicad_expr_tag_name – The KiCad expression tag name for for this element (“instances”).
- projects: list[SymbolUseInstanceProject]
- class edea.kicad.schematic.__init__.SymbolUse(lib_name: str | None = None, lib_id: str = '', at: tuple[float, float, ~typing.Literal[0, 90, 180, 270]] = (0, 0, 0), mirror: ~typing.Literal['x', 'y', None] = None, unit: int = 1, convert: int | None = None, exclude_from_sim: bool | None = None, in_bom: bool = True, on_board: bool = True, dnp: bool = False, fields_autoplaced: bool = False, uuid: ~uuid.UUID = <factory>, default_instance: ~edea.kicad.schematic.__init__.DefaultInstance | None = None, properties: list[~edea.kicad.schematic.symbol.Property] = <factory>, pins: list[~edea.kicad.schematic.__init__.PinAssignment] = <factory>, instances: ~edea.kicad.schematic.__init__.SymbolUseInstances | None = None, reference: str = <property object>, value: str = <property object>)
Bases:
KicadSchExpr
A symbol instance placed within a KiCad schematic.
- Parameters:
lib_name – The library name where the symbol is defined (KiCad library identifier).
lib_id – The library symbol ID.
at – The X-Y coordinates and rotation angle of the symbol instance.
mirror – Optional mirroring applied to the symbol.
unit – Which unit in the symbol library definition that the schematic symbol represents.
convert – The conversion factor for the symbol.
exclude_from_sim – Whether the symbol is excluded from simulation.
in_bom – Whether the symbol should be included in the Bill of Materials or not.
on_board – Whether the symbol is exported to the board via the netlist.
dnp – “Do Not Populate” flag for the symbol.
fields_autoplaced – Whether the symbol fields are automatically placed.
uuid – The unique identifier for the symbol instance.
default_instance – Default component instance associated with the symbol.
properties – A list of property objects associated with the symbol.
pins – A list of
PinAssignment
objects defining pin assignments for the symbol.instances – Nested
SymbolUseInstances
object defining symbol usage within hierarchical symbols.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“symbol”).
Note
The exclude_from_sim field was added in 20231120 (KiCad 8).
- default_instance: DefaultInstance | None = None
- properties: list[Property]
- pins: list[PinAssignment]
- instances: SymbolUseInstances | None = None
- class edea.kicad.schematic.__init__.Wire(pts: ~edea.kicad.common.Pts = <factory>, stroke: ~edea.kicad.common.Stroke = <factory>, uuid: ~uuid.UUID = <factory>)
Bases:
KicadSchExpr
A wire element within a KiCad schematic.
- Parameters:
pts – the list of X-Y coordinates of start and end points of the wire.
stroke – How the wire or bus is drawn.
uuid – The wire id.
- pts: Pts
- stroke: Stroke
- class edea.kicad.schematic.__init__.Junction(at: tuple[float, float], diameter: float = 0, color: tuple[int, int, int, float] = (0, 0, 0, 0.0), uuid: ~uuid.UUID = <factory>)
Bases:
KicadSchExpr
A junction (connection point) within a KiCad schematic.
- Parameters:
at – The X-Y coordinates of the junction.
diameter – The diameter of the junction.
color – RGBA color.
uuid – The junction id.
- class edea.kicad.schematic.__init__.NoConnect(at: tuple[float, float], uuid: ~uuid.UUID = <factory>)
Bases:
KicadSchExpr
A “No Connect” element within a KiCad schematic, indicating an unused pin.
- Parameters:
at – The X-Y coordinates of the “No Connect” symbol.
uuid – The unused junction id.
- class edea.kicad.schematic.__init__.LocalLabel(text: str, at: tuple[float, float, ~typing.Literal[0, 90, 180, 270]], fields_autoplaced: bool = False, effects: ~edea.kicad.common.Effects = <factory>, uuid: ~uuid.UUID = <factory>, properties: list[~edea.kicad.schematic.symbol.Property] = <factory>)
Bases:
KicadSchExpr
A local label element within a KiCad schematic.
- Parameters:
text – The string that defines the label.
at – The X-Y coordinates and rotation angle of the label.
fields_autoplaced – Whether the label fields are automatically placed.
effects – How the label text is drawn.
properties – A list of property objects associated with the label.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“label”).
- effects: Effects
- properties: list[Property]
- class edea.kicad.schematic.__init__.Text(text: str, at: tuple[float, float, ~typing.Literal[0, 90, 180, 270]], fields_autoplaced: bool = False, effects: ~edea.kicad.common.Effects = <factory>, uuid: ~uuid.UUID = <factory>, properties: list[~edea.kicad.schematic.symbol.Property] = <factory>, exclude_from_sim: bool | None = None)
Bases:
LocalLabel
A simple text element within a KiCad schematic.
- Parameters:
exclude_from_sim – Whether the text is excluded from simulation.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“text”).
Note
The exclude_from_sim field was added in 20231120 (KiCad 8).
- class edea.kicad.schematic.__init__.TextBox(text: str, at: tuple[float, float, ~typing.Literal[0, 90, 180, 270]], size: tuple[float, float], exclude_from_sim: bool | None = None, stroke: ~edea.kicad.common.Stroke = <factory>, fill: ~edea.kicad.schematic.shapes.FillSimple | ~edea.kicad.schematic.shapes.FillColor | ~edea.kicad.schematic.shapes.FillTypeColor = <factory>, effects: ~edea.kicad.common.Effects = <factory>, uuid: ~uuid.UUID = <factory>)
Bases:
KicadSchExpr
A text box element within a KiCad schematic.
- Parameters:
text – The text content of the box.
at – The X-Y coordinates and rotation angle of the text box.
size – The size of the text box.
exclude_from_sim – Whether the text box is excluded from simulation.
stroke – The line width and style of the text box.
fill – How the text box is filled.
effects – How the text box is displayed.
uuid – The unique identifier for the text box.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“text_box”).
Note
The exclude_from_sim field was added in 20231120 (KiCad 8).
- stroke: Stroke
- fill: FillSimple | FillColor | FillTypeColor
- effects: Effects
- class edea.kicad.schematic.__init__.LabelShape(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
StrEnum
Different shapes allowed for global labels in KiCad schematics.
- class edea.kicad.schematic.__init__.GlobalLabel(text: str, shape: ~edea.kicad.schematic.__init__.LabelShape = 'bidirectional', at: tuple[float, float, ~typing.Literal[0, 90, 180, 270]] = (0, 0, 0), fields_autoplaced: bool = False, effects: ~edea.kicad.common.Effects = <factory>, uuid: ~uuid.UUID = <factory>, properties: list[~edea.kicad.schematic.symbol.Property] = <factory>)
Bases:
KicadSchExpr
A global label element within a KiCad schematic.
- Parameters:
text – The string that defines the global label.
shape – The way the global label is drawn.
at – The X-Y coordinates and rotation angle of the label.
fields_autoplaced – A flag that indicates that any properties associated with the global label have been place automatically.
effects – How the global label text is drawn.
uuid – The global label id.
properties – The properties of the global label.
- shape: LabelShape = 'bidirectional'
- effects: Effects
- properties: list[Property]
- class edea.kicad.schematic.__init__.HierarchicalLabel(text: str, shape: ~edea.kicad.schematic.__init__.LabelShape = 'bidirectional', at: tuple[float, float, ~typing.Literal[0, 90, 180, 270]] = (0, 0, 0), fields_autoplaced: bool = False, effects: ~edea.kicad.common.Effects = <factory>, uuid: ~uuid.UUID = <factory>, properties: list[~edea.kicad.schematic.symbol.Property] = <factory>)
Bases:
KicadSchExpr
A hierarchical label element within a KiCad schematic.
- Parameters:
text – The string that defines the hierarchical label.
shape – The way the hierarchical label is drawn.
at – The X-Y coordinates and rotation angle of the hierarchical label.
fields_autoplaced – A flag that indicates that any properties associated with the hierarchical label have been place automatically.
effects – How the hierarchical label text is drawn.
uuid – The hierarchical label id.
properties – he properties of the hierarchical label.
- shape: LabelShape = 'bidirectional'
- effects: Effects
- properties: list[Property]
- class edea.kicad.schematic.__init__.NetclassFlag(text: str, length: float, shape: ~typing.Literal['rectangle', 'round', 'diamond', 'dot'], at: tuple[float, float, ~typing.Literal[0, 90, 180, 270]], fields_autoplaced: bool = False, effects: ~edea.kicad.common.Effects = <factory>, uuid: ~uuid.UUID = <factory>, properties: list[~edea.kicad.schematic.symbol.Property] = <factory>)
Bases:
KicadSchExpr
A net class flag element within a KiCad schematic.
- Parameters:
text – The text content of the net class flag.
length – The length of the net class flag.
shape – The way the net class flag is drawn.
at – The X-Y coordinates and rotation angle of the the net class flag’s position.
fields_autoplaced – Whether to auto place the net class flag or not.
effects – How the net class flag is drawn.
uuid – The net class flag id.
properties – The properties of the the net class flag.
- effects: Effects
- properties: list[Property]
- class edea.kicad.schematic.__init__.LibSymbols(symbols: list[~edea.kicad.schematic.symbol.LibSymbol] = <factory>)
Bases:
KicadSchExpr
A collection of library symbol references within a KiCad schematic.
- Parameters:
symbols – A list of
edea.kicad.schematic.symbol.LibSymbol
objects defining individual symbol references.
- symbols: list[LibSymbol]
- class edea.kicad.schematic.__init__.SymbolInstancesPath(path: str, reference: str, unit: int, value: str, footprint: str)
Bases:
KicadSchExpr
A path within a hierarchical symbol referencing another symbol within a KiCad schematic.
- Parameters:
path – The path string specifying the hierarchical location.
reference – The reference name of the symbol being referenced.
unit – An integer ordinal that defines the symbol unit for the symbol instance. For symbols that do not define multiple units, this will always be 1.
value – The value of the symbol instance.
footprint – The footprint associated with the symbol instance.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“path”).
- class edea.kicad.schematic.__init__.SymbolInstances(paths: list[~edea.kicad.schematic.__init__.SymbolInstancesPath] = <factory>)
Bases:
KicadSchExpr
A collection of symbol instances within a KiCad schematic.
- Parameters:
paths – A list of
SymbolInstancesPath
objects defining individual symbol instance paths.- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“instances”).
- paths: list[SymbolInstancesPath]
- class edea.kicad.schematic.__init__.SheetPin(name: str, shape: ~edea.kicad.schematic.__init__.LabelShape = 'bidirectional', at: tuple[float, float, ~typing.Literal[0, 90, 180, 270]] = (0, 0, 0), effects: ~edea.kicad.common.Effects = <factory>, uuid: ~uuid.UUID = <factory>)
Bases:
KicadSchExpr
A pin element on a sheet within a KiCad schematic.
- Parameters:
name – The name of the pin.
shape – The shape of the pin label.
at – The X-Y coordinates and rotation angle of the pin.
effects – Reference to an Effects object defining text effects.
uuid – The unique identifier (UUID) for the pin element.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“pin”).
- shape: LabelShape = 'bidirectional'
- effects: Effects
- class edea.kicad.schematic.__init__.SheetInstancesPath(name: str, page: str)
Bases:
KicadSchExpr
A path within a hierarchical schematic referencing another sheet.
- Parameters:
name – The name of the referenced sheet.
page – The page of the referenced sheet within the project.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“path”).
- class edea.kicad.schematic.__init__.SheetInstances(paths: list[~edea.kicad.schematic.__init__.SheetInstancesPath] = <factory>)
Bases:
KicadSchExpr
A collection of sheet instances within a hierarchical KiCad schematic.
- Parameters:
paths – A list of SheetInstancesPath objects defining individual sheet instance paths.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“sheet_instances”).
- paths: list[SheetInstancesPath]
- class edea.kicad.schematic.__init__.SubSheetInstanceProject(name: str, paths: list[~edea.kicad.schematic.__init__.SheetInstancesPath] = <factory>)
Bases:
KicadSchExpr
A sub-sheet instance referencing another project within a KiCad schematic.
- Parameters:
name – The name of the referenced project.
paths – A list of SheetInstancesPath objects defining paths within the referenced project.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“project”).
- paths: list[SheetInstancesPath]
- class edea.kicad.schematic.__init__.SubSheetInstances(projects: list[~edea.kicad.schematic.__init__.SubSheetInstanceProject] = <factory>)
Bases:
KicadSchExpr
A sub-sheet instance within a KiCad schematic.
- Parameters:
projects – A list of SubSheetInstanceProject objects defining projects within the sub-sheet.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“instances”).
- projects: list[SubSheetInstanceProject]
- class edea.kicad.schematic.__init__.Sheet(*, at: tuple[float, float] = (15.24, 15.24), size: tuple[float, float] = (15.24, 15.24), fields_autoplaced: bool = True, stroke: ~edea.kicad.common.Stroke = <factory>, fill: ~edea.kicad.schematic.shapes.FillColor = <factory>, uuid: ~uuid.UUID = <factory>, properties: list[~edea.kicad.schematic.symbol.Property] = <factory>, pins: list[~edea.kicad.schematic.__init__.SheetPin] = <factory>, instances: ~edea.kicad.schematic.__init__.SubSheetInstances | None = None, name: str = <property object>, file: ~pathlib.Path = <property object>)
Bases:
KicadSchExpr
A sheet element within a KiCad schematic.
- Parameters:
at – The X-Y coordinates of the sheet’s top-left corner.
size – The size of the sheet.
fields_autoplaced – Whether sheet fields are automatically placed or not.
stroke – Instance of Stroke object defining the sheet outline style.
fill – Instance of FillColor object defining the sheet fill style.
uuid – The unique identifier (UUID) for the sheet element.
properties – A list of Property objects defining sheet properties.
pins – A list of SheetPin objects defining pins on the sheet.
instances – Instance of SubSheetInstances object for hierarchical nesting.
name – Internal property to access the sheet name retrieved from “Sheetname” property within properties.
file – Internal property to access the sheet file path retrieved from “Sheetfile” property within properties.
- stroke: Stroke
- fill: FillColor
- properties: list[Property]
- pins: list[SheetPin]
- instances: SubSheetInstances | None = None
- class edea.kicad.schematic.__init__.BusEntry(at: tuple[float, float], size: tuple[float, float], stroke: ~edea.kicad.common.Stroke = <factory>, uuid: ~uuid.UUID = <factory>)
Bases:
KicadSchExpr
A bus entry element within a KiCad schematic.
- Parameters:
at – The X-Y coordinates of the bus entry.
size – The X and Y distance of the end point from the position of the bus entry.
stroke – How the bus entry is drawn.
uuid – The unique identifier (UUID) for the bus entry element.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“bus_entry”).
- stroke: Stroke
- class edea.kicad.schematic.__init__.Bus(pts: ~edea.kicad.common.Pts = <factory>, stroke: ~edea.kicad.common.Stroke = <factory>, uuid: ~uuid.UUID = <factory>)
Bases:
KicadSchExpr
A bus element within a KiCad schematic.
- Parameters:
pts – The list of X and Y coordinates of start and end points of the bus.
stroke – How the bus is drawn.
uuid – The unique identifier (UUID) for the bus.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“bus”).
- pts: Pts
- stroke: Stroke
- class edea.kicad.schematic.__init__.BusAlias(name: str, members: list[str] = <factory>)
Bases:
KicadSchExpr
A bus alias element within a KiCad schematic.
- Parameters:
name – The name of the bus alias.
members – A list of bus member names associated with the alias.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“bus_alias”).
- class edea.kicad.schematic.__init__.Schematic(version: ~typing.Literal['20231120', '20230121'] = '20231120', generator: str = 'edea', generator_version: str | None = None, uuid: ~uuid.UUID | None = None, paper: ~edea.kicad.common.PaperUser | ~edea.kicad.common.PaperStandard = <factory>, title_block: ~edea.kicad.common.TitleBlock | None = None, lib_symbols: ~edea.kicad.schematic.__init__.LibSymbols = <factory>, arcs: list[~edea.kicad.schematic.shapes.Arc] = <factory>, circles: list[~edea.kicad.schematic.shapes.Circle] = <factory>, sheets: list[~edea.kicad.schematic.__init__.Sheet] = <factory>, symbols: list[~edea.kicad.schematic.__init__.SymbolUse] = <factory>, rectangles: list[~edea.kicad.schematic.shapes.Rectangle] = <factory>, wires: list[~edea.kicad.schematic.__init__.Wire] = <factory>, polylines: list[~edea.kicad.schematic.shapes.Polyline] = <factory>, buses: list[~edea.kicad.schematic.__init__.Bus] = <factory>, images: list[~edea.kicad.common.Image] = <factory>, junctions: list[~edea.kicad.schematic.__init__.Junction] = <factory>, no_connects: list[~edea.kicad.schematic.__init__.NoConnect] = <factory>, bus_entries: list[~edea.kicad.schematic.__init__.BusEntry] = <factory>, text_items: list[~edea.kicad.schematic.__init__.Text] = <factory>, text_boxes: list[~edea.kicad.schematic.__init__.TextBox] = <factory>, labels: list[~edea.kicad.schematic.__init__.LocalLabel] = <factory>, hierarchical_labels: list[~edea.kicad.schematic.__init__.HierarchicalLabel] = <factory>, global_labels: list[~edea.kicad.schematic.__init__.GlobalLabel] = <factory>, netclass_flags: list[~edea.kicad.schematic.__init__.NetclassFlag] = <factory>, bus_aliases: list[~edea.kicad.schematic.__init__.BusAlias] = <factory>, sheet_instances: ~edea.kicad.schematic.__init__.SheetInstances | None = None, symbol_instances: ~edea.kicad.schematic.__init__.SymbolInstances = <factory>)
Bases:
KicadSchExpr
A KiCad schematic file structure.
- Parameters:
version – The KiCad schematic file format version.
generator – The schematic file generator software.
generator_version – The version of the schematic file generator software.
uuid – The unique identifier (UUID) for the schematic file.
uuid – The unique identifier (UUID) for the schematic file.
paper – The schematic sheet properties.
title_block – Title block information.
lib_symbols – Library symbol references.
arcs – Arcs within the schematic.
circles – Circles within the schematic.
sheets – Ondividual sheets within the schematic.
symbols – Symbol instances within the schematic.
rectangles – Rectangles within the schematic.
wires – Wires within the schematic.
polylines – Polylines within the schematic.
buses – Buses within the schematic.
images – Images within the schematic.
junctions – Junctions (connection points) within the schematic.
no_connects – Unconnected pins within the schematic.
bus_entries – Bus entries within the schematic.
text_items – Text elements within the schematic.
text_boxes – Text boxes within the schematic.
labels – Local labels within the schematic.
hierarchical_labels – Hierarchical labels within the schematic.
global_labels – Global labels within the schematic.
netclass_flags – List of NetclassFlag objects defining net class flags within the schematic.
bus_aliases – Bus aliases within the schematic.
sheet_instances – Sheet instances.
symbol_instances – Symbol instances within the schematic.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“kicad_sch”).
Note
The generator_version, and uuid fields were added in 20231120 (KiCad 8).
- classmethod check_version(v: Any) Literal['20231120', '20230121']
Checks KiCad schematic file format version.
- Returns v:
The version number.
- Raises:
VersionError – If the version format isn’t supported.
- paper: PaperUser | PaperStandard
- title_block: TitleBlock | None = None
- lib_symbols: LibSymbols
- arcs: list[Arc]
- circles: list[Circle]
- sheets: list[Sheet]
- symbols: list[SymbolUse]
- rectangles: list[Rectangle]
- wires: list[Wire]
- polylines: list[Polyline]
- buses: list[Bus]
- images: list[Image]
- junctions: list[Junction]
- no_connects: list[NoConnect]
- bus_entries: list[BusEntry]
- text_items: list[Text]
- text_boxes: list[TextBox]
- labels: list[LocalLabel]
- hierarchical_labels: list[HierarchicalLabel]
- global_labels: list[GlobalLabel]
- netclass_flags: list[NetclassFlag]
- bus_aliases: list[BusAlias]
- sheet_instances: SheetInstances | None = None
- symbol_instances: SymbolInstances