Checker $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#checker">
Checker interface $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#module-edea.kicad.checker" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#module-edea.kicad.checker'">
Proxies for the KiCad design rule checkers.
- class edea.kicad.checker.CheckResult(*, source: str, level: Severity, version: str, timestamp: datetime, dr: KicadDRCReporter | None = None, er: KicadERCReporter | None = None) $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.CheckResult" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.CheckResult'">
The result of a KiCad design check.
- Parameters:
source – The KiCad file got checked.
level – The severity.
version – The Kiad version used for the check.
timestamp – The timestamp of running the checker.
dr – The KiCad Design Rule Check (DRC) report.
er – The KiCad Electrical Rule Check (ERC) report.
- Returns:
The filtered and sorted check result.
- dr: KicadDRCReporter | None $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.CheckResult.dr" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.CheckResult.dr'">
- er: KicadERCReporter | None $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.CheckResult.er" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.CheckResult.er'">
- classmethod filter_by_level(value: Any) Any $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.CheckResult.filter_by_level" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.CheckResult.filter_by_level'">
Filters and sorts violations by severity level.
- Parameters:
value – The raw check result dictionary.
- Returns:
The filtered and sorted check result dictionary.
- model_config: ClassVar[ConfigDict] = {} $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.CheckResult.model_config" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.CheckResult.model_config'">
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- edea.kicad.checker.check(path: Path | str, custom_design_rules_path: Path | None = None, custom_design_rules_url: str | None = None, level: Severity = 'ignore') CheckResult $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.check" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.check'">
Checks a KiCad project for design rule violations.
- Parameters:
path – The directory path or the path of the KiCad project to be checked.
custom_design_rules_path – The path to custom design rules file.
custom_design_rules_url – The URL to custom design rules file.
level – The severity level to filter violations.
- Returns:
The check result.
- Raises:
FileNotFoundError – If the project files (.kicad_pcb or .kicad_sch) are not found.
- edea.kicad.checker.find_design_rules_file(project_path: Path) $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.find_design_rules_file" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.find_design_rules_file'">
- edea.kicad.checker.custom_design_rules(custom_rules_path: Path | None, custom_design_rules_url: str | None, project_path: Path) $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.custom_design_rules" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.custom_design_rules'">
A context manager that adds the design rules to project and delete it on exiting the context.
- Parameters:
custom_rules_path – The path to custom design rules file on disk.
custom_design_rules_url – The URL to custom design rules file.
project_path – The path to the KiCad project.
- Raises:
FileNotFoundError – If the project file or custom rules file is not found.
ValueError – If the custom design rules are not in kicad_dru format.
- Yields:
The path to the temporary custom design rules file added to the project.
Design rules checker $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#module-edea.kicad.checker.drc" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#module-edea.kicad.checker.drc'">
- Partially generated by datamodel-codegen:
filename: https://gitlab.com/kicad/code/kicad/-/raw/master/resources/schemas/drc.v1.json timestamp: 2024-01-03T16:11:36+00:00
- class edea.kicad.checker.drc.KicadDRCReport(*, field_schema: str | None, source: str, date: datetime, kicad_version: str, violations: List[Violation], unconnected_items: List[Violation], schematic_parity: List[Violation], coordinate_units: CoordinateUnits) $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.drc.KicadDRCReport" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.drc.KicadDRCReport'">
Bases:
BaseModel
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True} $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.drc.KicadDRCReport.model_config" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.drc.KicadDRCReport.model_config'">
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- kicad_version: Annotated[str, constr(pattern='^\\d{1,2}(\\.\\d{1,2}(\\.\\d{1,2})?)?$')] $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.drc.KicadDRCReport.kicad_version" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.drc.KicadDRCReport.kicad_version'">
Electrical rules checker $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#module-edea.kicad.checker.erc" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#module-edea.kicad.checker.erc'">
- Partially generated by datamodel-codegen:
filename: https://gitlab.com/kicad/code/kicad/-/raw/master/resources/schemas/erc.v1.json timestamp: 2024-01-04T10:32:53+00:00
- class edea.kicad.checker.erc.Sheet(*, uuid_path: str, path: str, violations: List[Violation]) $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.erc.Sheet" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.erc.Sheet'">
Bases:
BaseModel
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'} $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.erc.Sheet.model_config" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.erc.Sheet.model_config'">
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class edea.kicad.checker.erc.KicadERCReport(*, field_schema: str | None, source: str, date: datetime, kicad_version: str, sheets: List[Sheet], coordinate_units: CoordinateUnits | None = None) $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.erc.KicadERCReport" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.erc.KicadERCReport'">
Bases:
BaseModel
A KiCad Electrical Rule Check (ERC) report.
- Parameters:
field_schema – The JSON schema reference.
source – The source file path.
date – The time at generation of report.
kicad_version – The KiCad version used to generate the report.
sheets – List of sheets containing violations.
coordinate_units – The units that all coordinates in this report are encoded in.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True} $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.erc.KicadERCReport.model_config" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.erc.KicadERCReport.model_config'">
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- kicad_version: Annotated[str, constr(pattern='^\\d{1,2}(\\.\\d{1,2}(\\.\\d{1,2})?)?$')] $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.erc.KicadERCReport.kicad_version" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.erc.KicadERCReport.kicad_version'">
- sheets: List[Sheet] $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.erc.KicadERCReport.sheets" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.erc.KicadERCReport.sheets'">
- coordinate_units: CoordinateUnits | None $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.erc.KicadERCReport.coordinate_units" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.erc.KicadERCReport.coordinate_units'">
- property violations: List[Violation] $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.erc.KicadERCReport.violations" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.erc.KicadERCReport.violations'">
Gets a list of all violations from all sheets in the report.
- Returns:
List of violations.
Reporter $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#module-edea.kicad.checker.reporter" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#module-edea.kicad.checker.reporter'">
Load KiCad reports and generate reports from KiCad files.
- class edea.kicad.checker.reporter.RCReporter $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.reporter.RCReporter" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.reporter.RCReporter'">
Bases:
BaseModel
KiCad checker report generator.
- classmethod from_json_report(path: str | Path) $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.reporter.RCReporter.from_json_report" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.reporter.RCReporter.from_json_report'">
Creates a reporter instance from a JSON report file.
- Parameters:
path – The path to the JSON report file.
- Returns:
Instance of RCReporter.
- classmethod from_kicad_file(path: str | Path) $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.reporter.RCReporter.from_kicad_file" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.reporter.RCReporter.from_kicad_file'">
Creates a reporter instance from a KiCad file.
- Parameters:
path – The path to the KiCad file.
- Returns:
Instance of RCReporter.
- model_config: ClassVar[ConfigDict] = {} $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.reporter.RCReporter.model_config" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.reporter.RCReporter.model_config'">
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class edea.kicad.checker.reporter.KicadERCReporter(*, field_schema: str | None, source: str, date: datetime, kicad_version: str, sheets: List[Sheet], coordinate_units: CoordinateUnits | None = None) $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.reporter.KicadERCReporter" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.reporter.KicadERCReporter'">
Bases:
RCReporter
,KicadERCReport
A KiCad Electrical Rule Check (ERC).
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True} $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.reporter.KicadERCReporter.model_config" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.reporter.KicadERCReporter.model_config'">
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class edea.kicad.checker.reporter.KicadDRCReporter(*, field_schema: str | None, source: str, date: datetime, kicad_version: str, violations: List[Violation], unconnected_items: List[Violation], schematic_parity: List[Violation], coordinate_units: CoordinateUnits) $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.reporter.KicadDRCReporter" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.reporter.KicadDRCReporter'">
Bases:
KicadDRCReport
,RCReporter
A KiCad Design Rule Check (DRC).
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True} $el.setAttribute('data-tooltip', 'Copy link to this element'), 2000)" aria-label="Copy link to this element" class="headerlink" data-tooltip="Copy link to this element" href="#edea.kicad.checker.reporter.KicadDRCReporter.model_config" x-intersect.margin.0%.0%.-70%.0%="activeSection = '#edea.kicad.checker.reporter.KicadDRCReporter.model_config'">
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].