Schematic group

Adding sub-schematics to a KiCad schematic group.

class edea.kicad.schematic_group.SchematicFile(filepath: Path, data: Schematic)

Bases: object

A KiCad schematic file, containing the file path and the loaded schematic data.

Parameters:
  • filepath – The path to the schematic file.

  • data – The loaded schematic data object.

filepath: Path
data: Schematic
class edea.kicad.schematic_group.SchematicGroup(top_level: Schematic, top_level_filename: Path | str)

Bases: object

A group of KiCad schematic files.

Parameters:
  • top_level – The Schematic object representing the top-level schematic data.

  • top_level_filename – The path to the top-level schematic file.

classmethod load_from_disk(top_level: Path | str) SchematicGroup

Loads a SchematicGroup from a top-level schematic file on disk.

Parameters:

top_level – The path to the top-level schematic file.

add_sub_schematic(sch: Schematic, output_path: Path | str) UUID

Add a sub-schematic to the schematic group.

Parameters:
  • sch – The Schematic object representing the sub-schematic data to be added.

  • output_path – The path to save the sub-schematic file.

Returns:

The UUID of the newly added sub-schematic sheet.

Raises:
  • ValueError – If the ‘output_path’ already exists as the top-level schematic or as another sub-schematic within the group.

  • IndexError – If there are no existing sub-schematics.

write_to_disk(output_folder: Path | str)

Writes the whote SchematicGroup to disk, including the top-level schematic and all sub-schematics.

Parameters:

output_folder – The path to the output folder where the schematic files will be saved.