Serializer
Methods for turning EDeA dataclasses into strings and lists.
- edea.kicad.serializer.to_list(expr: KicadExpr) list[str | QuotedStr | list[str | QuotedStr | SExprList]]
Turns an EDeA dataclass (
KicadExpr
) into an s-expression list.- Parameters:
expr – The EDeA dataclass to convert.
- Returns:
The s-expression list representing the dataclass.
- edea.kicad.serializer.from_list_to_str(expr: str | QuotedStr | list[str | QuotedStr | list[str | QuotedStr | SExprList]]) str
Converts an S-Expression to a string representation.
- Parameters:
expr – The expression to convert.
- Returns:
The string representation of the expression.
- edea.kicad.serializer.to_str(expr: KicadExpr) str
Converts a
KicadExpr
to a string representation.- Parameters:
expr – The Kicad expression to convert.
- Returns:
The string representation of the Kicad expression.
- edea.kicad.serializer.write_pcb(path: Path | str, pcb: Pcb) None
Writes a
Pcb
to a file.- Parameters:
path – The path to write the PCB object to.
pcb – The PCB object to write.
- edea.kicad.serializer.write_schematic(path: Path | str, sch: Schematic) None
Writes a
Schematic
object to a file.- Parameters:
path – The path to write the schematic object to.
sch – The schematic object to write.