Project
Dataclasses describing the contents of .kicad_pro files.
- class edea.kicad.project.Dimensions(*, arrow_length: int, extension_offset: int, keep_text_aligned: bool, suppress_zeroes: bool, text_position: int, units_format: int, **extra_data: Any)
Bases:
BaseModel
The dimensions configuration.
- Parameters:
arrow_length – The length of the arrow.
extension_offset – The offset for extension.
keep_text_aligned – A flag to keep text aligned.
suppress_zeroes – A flag to suppress zeroes.
text_position – The position of the text.
units_format – The format of the units.
- class edea.kicad.project.Pads(*, drill: float, height: float, width: float, **extra_data: Any)
Bases:
BaseModel
The pad configuration.
- Parameters:
drill – The drill size.
height – The height of the pad.
width – The width of the pad.
- class edea.kicad.project.Zones(*, field_45_degree_only: bool | None = None, min_clearance: float, **extra_data: Any)
Bases:
BaseModel
The zone configuration.
- Parameters:
field_45_degree_only – A flag for 45-degree clearance.
min_clearance – The minimum clearance.
- class edea.kicad.project.Defaults(*, board_outline_line_width: float | None = None, copper_line_width: float | None = None, copper_text_italic: bool | None = None, copper_text_size_h: float | None = None, copper_text_size_v: float | None = None, copper_text_thickness: float | None = None, copper_text_upright: bool | None = None, courtyard_line_width: float | None = None, dimension_precision: int | None = None, dimension_units: int | None = None, dimensions: Dimensions | None = None, fab_line_width: float | None = None, fab_text_italic: bool | None = None, fab_text_size_h: float | None = None, fab_text_size_v: float | None = None, fab_text_thickness: float | None = None, fab_text_upright: bool | None = None, other_line_width: float | None = None, other_text_italic: bool | None = None, other_text_size_h: float | None = None, other_text_size_v: float | None = None, other_text_thickness: float | None = None, other_text_upright: bool | None = None, pads: Pads | None = None, silk_line_width: float | None = None, silk_text_italic: bool | None = None, silk_text_size_h: float | None = None, silk_text_size_v: float | None = None, silk_text_thickness: float | None = None, silk_text_upright: bool | None = None, zones: Zones | None = None, **extra_data: Any)
Bases:
BaseModel
Various configuration options related to the visual appearance of a PCB layout.
- Parameters:
board_outline_line_width – The board outline line width.
copper_line_width – The copper traces line width.
copper_text_italic – Whether copper text should be italic or not.
copper_text_size_h – The horizontal size of copper text.
copper_text_size_v – The vertical size of copper text.
copper_text_thickness – The thickness of copper text.
copper_text_upright – Whether copper text should be upright or not.
courtyard_line_width – The width of the line used to draw component courtyards.
dimension_precision – The precision (number of decimal places) used for dimensions.
dimension_units – The mesurement units (e.g., millimeters, inches) used for dimensions.
dimensions – Instance of the
Dimensions
representing dimensions configuration.fab_line_width – The width of the line used to draw fabrication lines.
fab_text_italic – Whether fabrication text should be italicized or not.
fab_text_size_h – The horizontal size of fabrication text.
fab_text_size_v – The vertical size of fabrication text.
fab_text_thickness – The thickness of fabrication text.
fab_text_upright – Whether fabrication text should be upright or not.
other_line_width – The width of the line used for miscellaneous features.
other_text_italic – Whether miscellaneous text should be italicized or not.
other_text_size_h – The horizontal size of miscellaneous text.
other_text_size_v – The vertical size of miscellaneous text.
other_text_thickness – The thickness of miscellaneous text.
other_text_upright – Whether miscellaneous text should be upright or not.
pads – Instance of the
Pads
, representing pad configuration.silk_line_width – The width of the line used for silkscreen features.
silk_text_italic – Whether the silkscreen text should be italicized or not.
silk_text_size_h – The horizontal size of silkscreen text.
silk_text_size_v – The vertical size of silkscreen text.
silk_text_thickness – The thickness of silkscreen text.
silk_text_upright – Whether the silkscreen text should be upright or not.
zones – Instance of
Zones
, representing zone configuration.
- dimensions: Dimensions | None
- pads: Pads | None
- zones: Zones | None
- class edea.kicad.project.Meta(*, filename: str | None = None, version: int, **extra_data: Any)
Bases:
BaseModel
Stores metadata associated with project files.
- Parameters:
filename – The file name.
version – The version kicad format.
- class edea.kicad.project.Rules(*, allow_blind_buried_vias: bool | None = None, allow_microvias: bool | None = None, max_error: float | None = None, min_clearance: float | None = None, min_connection: float | None = None, min_copper_edge_clearance: float | None = None, solder_mask_clearance: float | None = None, solder_mask_min_width: float | None = None, solder_paste_clearance: float | None = None, solder_paste_margin_ratio: float | None = None, min_hole_clearance: float | None = None, min_hole_to_hole: float | None = None, min_microvia_diameter: float | None = None, min_microvia_drill: float | None = None, min_resolved_spokes: int | None = None, min_silk_clearance: float | None = None, min_text_height: float | None = None, min_text_thickness: float | None = None, min_through_hole_diameter: float | None = None, min_track_width: float | None = None, min_via_annular_width: float | None = None, min_via_diameter: float | None = None, solder_mask_to_copper_clearance: float | None = None, use_height_for_length_calcs: bool | None = None, **extra_data: Any)
Bases:
BaseModel
Various design rules used for validating a PCB layout.
- Parameters:
allow_blind_buried_vias – Whether blind and buried vias are allowed or not.
allow_microvias – Whether microvias are allowed or not.
max_error – The maximum allowed error during design rule checks.
min_clearance – The minimum clearance between objects on the PCB.
min_connection – The minimum allowed size for connections (e.g., traces).
min_copper_edge_clearance – The minimum clearance between copper features and other objects.
solder_mask_clearance – The clearance between solder mask and other objects.
solder_mask_min_width – The minimum width of solder mask features.
solder_paste_clearance – The clearance between solder paste and other objects.
solder_paste_margin_ratio – The ratio defining the margin for solder paste application.
min_hole_clearance – The minimum clearance between holes.
min_hole_to_hole – The minimum distance between center points of holes.
min_microvia_diameter – The minimum diameter for microvias.
min_microvia_drill – The minimum drill size for microvias.
min_resolved_spokes – The minimum number of spokes allowed in rounded corners.
min_silk_clearance – The minimum clearance between silkscreen features and other objects.
min_text_height – The minimum height of text on the PCB.
min_text_thickness – The minimum thickness of text on the PCB.
min_through_hole_diameter – The minimum diameter for through-hole pads.
min_track_width – The minimum allowed width for tracks (traces).
min_via_annular_width – The minimum width of the annular ring around vias.
min_via_diameter – The minimum diameter for vias.
solder_mask_to_copper_clearance – The clearance between solder mask and copper features.
use_height_for_length_calcs – Whether to use via height for length calculations or not.
- class edea.kicad.project.TeardropOption(*, td_allow_use_two_tracks: bool | None = None, td_curve_segcount: int | None = None, td_on_pad_in_zone: bool | None = None, td_onpadsmd: bool | None = None, td_onroundshapesonly: bool | None = None, td_ontrackend: bool | None = None, td_onviapad: bool | None = None, **extra_data: Any)
Bases:
BaseModel
The options controlling the generation of teardrops on the PCB layout.
- Parameters:
td_allow_use_two_tracks – Whether two tracks can be used to form a teardrop or not.
td_curve_segcount – The number of segments used to approximate a curved teardrop shape.
td_on_pad_in_zone – Whether teardrops are allowed on pads within zones or not.
td_onpadsmd – Whether if teardrops are allowed on SMD pads or not.
td_onroundshapesonly – Whether teardrops are only applied to round shapes or not.
td_ontrackend – Whether teardrops are applied on track ends or not.
td_onviapad – Whether teardrops are allowed on via pads or not.
- class edea.kicad.project.TeardropParameter(*, td_curve_segcount: int, td_height_ratio: float, td_length_ratio: float, td_maxheight: float, td_maxlen: float, td_target_name: str, td_width_to_size_filter_ratio: float | None = None, **extra_data: Any)
Bases:
BaseModel
The parameters used to control the shape and size of teardrops.
- Parameters:
td_curve_segcount – The number of segments used to approximate a curved teardrop shape.
td_height_ratio – The ratio of teardrop height to pad size.
td_length_ratio – The ratio of teardrop length to pad size.
td_maxheight – The maximum allowed height of a teardrop.
td_maxlen – The maximum allowed length of a teardrop.
td_target_name – The name of the target layer for teardrops.
td_width_to_size_filter_ratio – The ratio of teardrop width to pad size for filtering.
- class edea.kicad.project.ViaDimension(*, diameter: float, drill: float, **extra_data: Any)
Bases:
BaseModel
The diameter and drill size of a via.
- Parameters:
diameter – The diameter of the via pad.
drill – The drill size of the via hole.
- class edea.kicad.project.DesignSettings(*, apply_defaults_to_field: bool | None = None, apply_defaults_to_shapes: bool | None = None, apply_defaults_to_fp_text: bool | None = None, defaults: Defaults | None = None, diff_pair_dimensions: list, drc_exclusions: list, meta: Meta | None = None, rule_severities: dict[str, Any] | None = None, rule_severitieslegacy_courtyards_overlap: bool | None = None, rule_severitieslegacy_no_courtyard_defined: bool | None = None, rules: Rules | None = None, teardrop_options: list[TeardropOption] | None = None, teardrop_parameters: list[TeardropParameter] | None = None, track_widths: list[float], via_dimensions: list[ViaDimension], zones_allow_external_fillets: bool | None = None, zones_use_no_outline: bool | None = None, **extra_data: Any)
Bases:
BaseModel
Various settings used for configuring the design process.
- Parameters:
apply_defaults_to_field – Whether default values should be applied to fields or not.
apply_defaults_to_shapes – Whether default values should be applied to shapes or not.
apply_defaults_to_fp_text – Whether default values should be applied to footprint text or not.
defaults – An Instance of
Defaults
.diff_pair_dimensions – A list of differential pair dimension settings.
drc_exclusions – A list of DRC (Design Rule Checks) exclusion rules.
meta – An instance of
Meta
.rule_severities – Dictionary defining severities for different design rules.
rule_severitieslegacy_courtyards_overlap – Whether legacy courtyard overlap severity is used or not.
rule_severitieslegacy_no_courtyard_defined – Whether legacy no courtyard defined severity is used or not.
rules – An instance of
Rules
.teardrop_options – List of
TeardropOption
defining teardrop options.teardrop_parameters – List of
TeardropParameter
defining teardrop parameters.track_widths – List of allowed track (trace) widths.
via_dimensions – List of
ViaDimension
defining via dimensions.zones_allow_external_fillets – Whether external fillets are allowed on zones or not.
zones_use_no_outline – Whether zones are allowed without an outline or not.
- defaults: Defaults | None
- meta: Meta | None
- rules: Rules | None
- teardrop_options: list[TeardropOption] | None
- teardrop_parameters: list[TeardropParameter] | None
- via_dimensions: list[ViaDimension]
- class edea.kicad.project.Board(*, field_3dviewports: list | None = None, design_settings: DesignSettings | None = None, layer_presets: list | None = None, viewports: list | None = None, **extra_data: Any)
Bases:
BaseModel
A PCB design within the context of a Cvpcb file.
- Parameters:
field_3dviewports – A list of 3D viewport definitions.
design_settings – An instance of
DesignSettings
.layer_presets – A list of layer preset definitions.
viewports – A list of viewport definitions.
- design_settings: DesignSettings | None
- class edea.kicad.project.Cvpcb(*, equivalence_files: list, **extra_data: Any)
Bases:
BaseModel
The root element of a Cvpcb file containing a PCB design.
- Parameters:
equivalence_files – A list of equivalence files associated with the PCB design.
- class edea.kicad.project.Erc(*, erc_exclusions: list, meta: Meta, pin_map: list[list[int]], rule_severities: dict[str, Any], **extra_data: Any)
Bases:
BaseModel
Electrical Rule Checking (ERC) settings.
- Parameters:
erc_exclusions – A list of ERC exclusion rules.
meta – An instance of
Meta
.pin_map – A list of lists representing pin mappings.
rule_severities – Dictionary defining severities for different ERC rules.
- meta: Meta
- class edea.kicad.project.Libraries(*, pinned_footprint_libs: list, pinned_symbol_libs: list, **extra_data: Any)
Bases:
BaseModel
Library settings for footprints and symbols.
- Parameters:
pinned_footprint_libs – List of pinned footprint libraries.
pinned_symbol_libs – List of pinned symbol libraries.
- class edea.kicad.project.Class(*, bus_width: int | None = None, clearance: float, diff_pair_gap: float, diff_pair_via_gap: float, diff_pair_width: float, line_style: int | None = None, microvia_diameter: float, microvia_drill: float, name: str, pcb_color: str | None = None, schematic_color: str | None = None, track_width: float, via_diameter: float, via_drill: float, wire_width: int | None = None, **extra_data: Any)
Bases:
BaseModel
The properties associated with a design class in the PCB layout.
- Parameters:
bus_width – The width of a bus (multiple connected tracks).
clearance – The clearance between objects
diff_pair_gap – The gap between tracks in a differential pair.
diff_pair_via_gap – The gap between vias in a differential pair.
diff_pair_width – The width of tracks in a differential pair.
line_style – The line style used.
microvia_diameter – The diameter of microvias.
microvia_drill – The drill size for microvias.
name – The name of the design class.
pcb_color – The color used on the PCB layout.
schematic_color – The color used on the schematic.
track_width – The default track width.
via_diameter – The diameter of vias.
via_drill – The drill size for vias.
wire_width – The width of wires.
- class edea.kicad.project.NetclassPattern(*, netclass: str, pattern: str, **extra_data: Any)
Bases:
BaseModel
A pattern for matching netclasses in the PCB design.
- Parameters:
netclass – The net class name to match.
pattern – A regular expression pattern for matching nets within the net class.
- class edea.kicad.project.NetSettings(*, classes: list[Class], meta: Meta, net_colors: dict[str, str] | None = None, netclass_assignments: dict[str, str] | None = None, netclass_patterns: list[NetclassPattern] | None = None, **extra_data: Any)
Bases:
BaseModel
Various settings related to nets (electrical connections) in the PCB design.
- Parameters:
classes – A list of
Class
objects.meta – An instance of
Meta
.net_colors – Dictionary mapping net names to their corresponding colors.
netclass_assignments – Dictionary mapping net names to their assigned net classes.
netclass_patterns – A list of
NetclassPattern
objects.
- classes: list[Class]
- meta: Meta
- netclass_patterns: list[NetclassPattern] | None
- class edea.kicad.project.LastPaths(*, gencad: str, idf: str, netlist: str, specctra_dsn: str, step: str, vrml: str, **extra_data: Any)
Bases:
BaseModel
Stores the paths to various generated files associated with the PCB design.
- Parameters:
gencad – The path to the generated GenCAD file.
idf – The path to the generated IDF file.
netlist – The path to the generated netlist file.
specctra_dsn – The path to the generated Specctra DSN file.
step – The path to the generated STEP file.
vrml – The path to the generated VRML file.
- class edea.kicad.project.Pcbnew(*, last_paths: LastPaths | None = None, page_layout_descr_file: str, **extra_data: Any)
Bases:
BaseModel
The PCBnew section within a Cvpcb file.
- Parameters:
last_paths – An instance of
LastPaths
.page_layout_descr_file – The path to the page layout description file.
- last_paths: LastPaths | None
- class edea.kicad.project.Drawing(*, dashed_lines_dash_length_ratio: float | None = None, dashed_lines_gap_length_ratio: float | None = None, default_line_thickness: float | None = None, default_text_size: float | None = None, default_bus_thickness: float | None = None, default_junction_size: float | None = None, default_wire_thickness: float | None = None, field_names: list | None = None, intersheets_ref_own_page: bool | None = None, intersheets_ref_prefix: str | None = None, intersheets_ref_short: bool | None = None, intersheets_ref_show: bool | None = None, intersheets_ref_suffix: str | None = None, junction_size_choice: int | None = None, label_size_ratio: float | None = None, pin_symbol_size: float | None = None, text_offset_ratio: float | None = None, **extra_data: Any)
Bases:
BaseModel
The settings related to the visual appearance of the PCB schematic drawing.
- Parameters:
dashed_lines_dash_length_ratio – The ratio of dash length to gap length for dashed lines.
dashed_lines_gap_length_ratio – The ratio of gap length to dash length for dashed lines.
default_line_thickness – The default thickness for lines in the schematic.
default_text_size – The default size for text in the schematic.
default_bus_thickness – The default thickness for buses (multiple connected wires) in the schematic.
default_junction_size – The default size for junctions (connection points) in the schematic.
default_wire_thickness – The default thickness for wires in the schematic.
field_names – List of field names displayed in the schematic.
intersheets_ref_own_page – Whether intersheet references point to the same page or not.
intersheets_ref_prefix – The prefix string used for intersheet references.
intersheets_ref_short – Whether intersheet references are shortened or not.
intersheets_ref_show – Whether if intersheet references are displayed or not.
intersheets_ref_suffix – The suffix string used for intersheet references.
junction_size_choice – The choice for the default junction size (e.g., absolute, relative).
label_size_ratio – The ratio of label size to element size.
pin_symbol_size – The size of pin symbols in the schematic.
text_offset_ratio – The ratio of text offset to element size.
- class edea.kicad.project.Ngspice(*, fix_include_paths: bool | None = None, fix_passive_vals: bool | None = None, meta: Meta | None = None, model_mode: int | None = None, workbook_filename: str | None = None, **extra_data: Any)
Bases:
BaseModel
The settings related to NGSPICE simulation for the PCB design.
- Parameters:
fix_include_paths – Whether to fix include paths for NGSPICE simulations or not.
fix_passive_vals – Whether to fix passive component values for NGSPICE simulations or not.
meta – An instance of
Meta
.model_mode – The mode used for NGSPICE model handling.
workbook_filename – The file name of the NGSPICE workbook.
- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'protected_namespaces': (), 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- meta: Meta | None
- class edea.kicad.project.ProjectSchematic(*, annotate_start_num: int | None = None, drawing: Drawing | None = None, legacy_lib_dir: str, legacy_lib_list: list, meta: Meta | None = None, net_format_name: str | None = None, ngspice: Ngspice | None = None, page_layout_descr_file: str | None = None, plot_directory: str | None = None, spice_adjust_passive_values: bool | None = None, spice_current_sheet_as_root: bool | None = None, spice_external_command: str | None = None, spice_model_current_sheet_as_root: bool | None = None, spice_save_all_currents: bool | None = None, spice_save_all_voltages: bool | None = None, subpart_first_id: int | None = None, subpart_id_separator: int | None = None, **extra_data: Any)
Bases:
BaseModel
The settings related to the project schematic associated with the project file.
- Parameters:
annotate_start_num – The starting number for schematic annotations.
drawing – An instance of
Drawing
.legacy_lib_dir – Directory containing legacy schematic symbol libraries.
legacy_lib_list – A list of legacy schematic symbol libraries to use.
meta – Reference to a Meta object containing PCB layout metadata.
net_format_name – The name of the netlist format for the schematic.
ngspice – An instance of
Ngspice
.page_layout_descr_file – The path to the schematic page layout description file.
plot_directory – Directory for storing simulation plots.
spice_adjust_passive_values – Whether to adjust passive component values for SPICE simulation or not.
spice_current_sheet_as_root – Whether the current schematic sheet is considered the root for SPICE simulation or not.
spice_external_command – External command to run for SPICE simulation.
spice_model_current_sheet_as_root – Whether the current schematic sheet is considered the root for NGSPICE model loading or not.
spice_save_all_currents – Whether to save all currents during SPICE simulation or not.
spice_save_all_voltages – Whether to save all voltages during SPICE simulation or not.
subpart_first_id – The starting ID for subparts in the schematic.
subpart_id_separator – The character used as separator for subpart IDs.
- drawing: Drawing | None
- meta: Meta | None
- ngspice: Ngspice | None
- class edea.kicad.project.ProjectSheet(uuid: UUID, name: str)
Bases:
NamedTuple
A project sheet within a KiCad project.
- Parameters:
uuid – The Universally Unique Identifier (UUID) of the project sheet.
name – The name of the project sheet.
- class edea.kicad.project.KicadProject(*, board: Board, boards: list, cvpcb: Cvpcb | None = None, erc: Erc | None = None, libraries: Libraries, meta: Meta, net_settings: NetSettings, pcbnew: Pcbnew, schematic: ProjectSchematic | None = None, sheets: list[ProjectSheet], text_variables: dict[str, Any], **extra_data: Any)
Bases:
BaseModel
The entire KiCad project structure as defined in a Cvpcb file.
- Parameters:
board – An instance of
Board
.boards – A list of board definitions.
cvpcb – An instance of
Cvpcb
.erc – An instance of
Erc
.libraries – An instance of
Libraries
.meta – An instance of
Meta
.net_settings – An instance of
NetSettings
.pcbnew – An instance of
Pcbnew
.schematic – An instance of
ProjectSchematic
.sheets – A list of project sheets.
text_variables – A dictionary of text variables.
- board: Board
- cvpcb: Cvpcb | None
- erc: Erc | None
- libraries: Libraries
- meta: Meta
- net_settings: NetSettings
- pcbnew: Pcbnew
- schematic: ProjectSchematic | None
- sheets: list[ProjectSheet]