Schematic And Symbol API

KiCadSchematic

Rationale

Callers need a single document object for schematic parse, query, mutation, round-trip writing, and IR-backed SVG generation.

Purpose

Own the schematic-level OOP model, expose object/property query views, and provide stable add, remove, lookup, serialization, and IR entrypoints.

Test Requirements

Tests must cover object mutation, property aggregation, read-only query views, symbol lookup behavior, and the public IR entrypoint.

Working Definition

A schematic facade is public when file callers can use it without touching S-expression internals for common read, cleanup, and render workflows.

KiCadSymbolLib

Rationale

Symbol-library tools need a stable container for reading, merging, splitting, lookup, and rendering without depending on parser internals.

Purpose

Represent a KiCad symbol library and expose symbol lookup, construction, serialization, and symbol-to-IR entrypoints.

Test Requirements

Tests must cover construction, symbol lookup, and the library-level IR alias used by SVG and downstream conversion flows.

Working Definition

A symbol-library facade is public when a caller can load or build a library, find a symbol, and render or write it through documented methods.

LibSymbol

Rationale

Library-symbol cleanup and conversion tools need direct property mutation, parameter cleanup, and IR rendering on individual symbols.

Purpose

Model one library symbol with standard property helpers, custom property mutation, graphics, pins, and symbol-level IR conversion.

Test Requirements

Tests must cover standard keys, generated user property IDs, get/set/remove helpers, and the public IR entrypoint.

Working Definition

A library symbol is public when callers can perform common cleanup and rendering tasks through named properties and methods.

SchSymbol

Rationale

File-based schematic automation commonly edits placed symbol references, values, footprints, and custom parameters.

Purpose

Represent a placed schematic symbol with named standard-property helpers and stable property mutation methods.

Test Requirements

Tests must cover reference/value helpers, create-on-set behavior, property-object access, and removal.

Working Definition

A schematic symbol is public when common parameter cleanup can be done without direct S-expression edits.

SchSheet

Rationale

Hierarchical schematic tools need named access to sheet file/name properties and stable mutation behavior.

Purpose

Represent a hierarchical sheet with standard sheet-property helpers and consistent property mutation methods.

Test Requirements

Tests must cover standard sheet keys, sheet-file access, object-query integration, and property aggregation.

Working Definition

A sheet facade is public when callers can inspect and update hierarchy metadata through the same property style as symbols.