Types
Common type definitions used across the Zeo Python API.
Common Types
KIID
Unique identifier for schematic and board items.
# KIIDs are returned by most creation methods
symbol_id = sch.symbols.add("Device:R", pos)
print(type(symbol_id)) # str (KIID)
# Use KIIDs to reference items
sch.symbols.move(symbol_id, new_pos)
sch.symbols.delete(symbol_id)
DocumentSpecifier
Identifies a document (schematic, board, or project).
from kipy.proto.common.types import DocumentSpecifier, DocumentType
# Get from KiCad
docs = kicad.get_open_documents(DocumentType.DOCTYPE_PCB)
doc = docs[0]
print(doc.type) # DOCTYPE_PCB
print(doc.project) # Project info
DocumentType
Types of documents.
from kipy.proto.common.types import DocumentType
DocumentType.DOCTYPE_PCB # PCB document
DocumentType.DOCTYPE_SCHEMATIC # Schematic document
DocumentType.DOCTYPE_MBS_SCHEMATIC # Multi-board schematic (.kicad_mbs)
DocumentType.DOCTYPE_PROJECT # Project
DOCTYPE_MBS_SCHEMATIC is the document type for the top-level multi-board schematic file. See Multi-Board Overview.
Schematic Types
SymbolInstance
Information about a placed symbol.
class SymbolInstance:
id: str # KIID
lib_id: str # Library ID (e.g., "Device:R")
reference: str # Reference designator
value: str # Value field
position: Vector2 # Position
rotation: float # Rotation in degrees
mirror: bool # Is mirrored
unit: int # Unit number (for multi-unit symbols)
PinInfo
Information about a symbol pin.
class PinInfo:
number: str # Pin number
name: str # Pin name
position: Vector2 # Position
type: str # Pin type
orientation: str # Pin orientation
LabelInfo
Information about a label.
class LabelInfo:
id: str # KIID
text: str # Label text (net name)
position: Vector2 # Position
orientation: str # Orientation
type: str # Label type (local, global, hierarchical)
Board Types
FootprintInstance
Information about a placed footprint.
class FootprintInstance:
id: str # KIID
lib_id: str # Library ID
reference: str # Reference designator
value: str # Value field
position: Vector2 # Position
rotation: float # Rotation in degrees
layer: BoardLayer # Side (F_Cu or B_Cu)
locked: bool # Is locked
PadInfo
Information about a footprint pad.
class PadInfo:
number: str # Pad number
name: str # Pad name
position: Vector2 # Position
size: Vector2 # Pad size
shape: str # Pad shape
layers: List[BoardLayer] # Pad layers
net: str # Connected net name
Track
Information about a track segment.
class Track:
id: str # KIID
start: Vector2 # Start position
end: Vector2 # End position
width: int # Width in internal units
layer: BoardLayer # Layer
net: str # Net name
Via
Information about a via.
class Via:
id: str # KIID
position: Vector2 # Position
size: int # Via diameter
drill: int # Drill diameter
start_layer: BoardLayer # Start layer
end_layer: BoardLayer # End layer
net: str # Net name
Zone
Information about a zone.
class Zone:
id: str # KIID
layer: BoardLayer # Layer
net: str # Net name
priority: int # Fill priority
is_filled: bool # Is filled
outline: List[Vector2] # Zone boundary
Layer Enums
BoardLayer
PCB layer identifiers.
from kipy.board import BoardLayer
# Copper layers
BoardLayer.BL_F_Cu # Front copper
BoardLayer.BL_B_Cu # Back copper
BoardLayer.BL_In1_Cu # Inner 1
BoardLayer.BL_In2_Cu # Inner 2
# ... up to In30_Cu
# Technical layers
BoardLayer.BL_F_SilkS # Front silkscreen
BoardLayer.BL_B_SilkS # Back silkscreen
BoardLayer.BL_F_Mask # Front solder mask
BoardLayer.BL_B_Mask # Back solder mask
BoardLayer.BL_F_Paste # Front paste
BoardLayer.BL_B_Paste # Back paste
BoardLayer.BL_F_CrtYd # Front courtyard
BoardLayer.BL_B_CrtYd # Back courtyard
BoardLayer.BL_F_Fab # Front fabrication
BoardLayer.BL_B_Fab # Back fabrication
BoardLayer.BL_Edge_Cuts # Board outline
# User layers
BoardLayer.BL_User_1 # User 1
# ... up to User_45
BoardLayerClass
Layer class identifiers.
from kipy.board import BoardLayerClass
BoardLayerClass.BLC_COPPER # Copper layers
BoardLayerClass.BLC_TECHNICAL # Technical layers
BoardLayerClass.BLC_USER # User layers
DRC Types
DRCViolation
Information about a DRC violation.
class DRCViolation:
description: str # Human-readable description
rule_id: str # Rule identifier
severity: str # "error" or "warning"
position: Vector2 # Location
items: List[str] # Item IDs involved
DRCSettings
DRC configuration settings.
class DRCSettings:
test_tracks_vs_zones: bool
test_footprints: bool
test_courtyard_overlap: bool
refill_zones: bool
Error Types
ApiError
General API error.
from kipy.errors import ApiError
try:
board = kicad.get_board()
except ApiError as e:
print(f"API error: {e}")
print(f"Code: {e.code}")
print(f"Message: {e.raw_message}")
ConnectionError
Connection to Zeo failed.
from kipy.errors import ConnectionError
try:
kicad = KiCad()
except ConnectionError:
print("Could not connect to Zeo")
FutureVersionError
Library is older than connected Zeo.
from kipy.errors import FutureVersionError
try:
kicad.check_version()
except FutureVersionError as e:
print(f"Version mismatch: {e}")