Common
- class edea.kicad.common.StrokeType(value)
Bases:
StrEnum
Available stroke types that can be used for lines, outlines, etc.
- class edea.kicad.common.Stroke(width: float = 0, type: StrokeType = 'default', color: Annotated[tuple[int, int, int, float], 'kicad_omits_default'] = (0, 0, 0, 0.0))
Bases:
KicadExpr
Properties of a stroke used within KiCad expressions.
- Parameters:
width – The line width of the graphic object.
type – The line style of the graphic object.
color – The red, green, blue, and alpha color settings.
- type: StrokeType = 'default'
- classmethod from_list(exprs: list[str | QuotedStr | list[str | QuotedStr | SExprList]]) Self
Turns an s-expression list of arguments into an EDeA dataclass. Note that you omit the tag name in the s-expression so e.g. for (symbol “foo” (pin 1)) you would pass [“foo”, [“pin”, 1]] to this method.
- Returns:
An instance of the ‘KicadExpr’ created from the KiCad expression data.
- class edea.kicad.common.PaperFormat(value)
Bases:
StrEnum
Various standard paper formats like A series A0, A1, B series, etc.
- class edea.kicad.common.PaperOrientation(value)
Bases:
StrEnum
The two common paper shown modes: landscape and portrait.
- class edea.kicad.common.PaperUser(format: Annotated[Literal['User'], 'kicad_no_kw', 'kicad_always_quotes'] = 'User', width: Annotated[float, 'kicad_no_kw'] = 0, height: Annotated[float, 'kicad_no_kw'] = 0)
Bases:
KicadExpr
A custom KiCad paper size definition.
- Parameters:
format – Always set to “User” to indicate a custom format.
width – The width of the paper in KiCad units.
height – The height of the paper in KiCad units
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“paper”).
- class edea.kicad.common.PaperStandard(format: Annotated[PaperFormat, 'kicad_no_kw', 'kicad_always_quotes'] = 'A4', orientation: Annotated[PaperOrientation, 'kicad_no_kw', 'kicad_omits_default'] = '')
Bases:
KicadExpr
A standard KiCad paper size.
- Parameters:
format – The paper format from the PaperFormat enum.
orientation – The paper orientation from the PaperOrientation enum.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“paper”).
- format: Annotated[PaperFormat, 'kicad_no_kw', 'kicad_always_quotes'] = 'A4'
- orientation: Annotated[PaperOrientation, 'kicad_no_kw', 'kicad_omits_default'] = ''
- class edea.kicad.common.PolygonArc(start: tuple[float, float], mid: tuple[float, float], end: tuple[float, float])
Bases:
KicadExpr
A polygonal arc KiCad expression element.
- Parameters:
start – The starting X-Y coordinates of the arc.
mid – The midpoint X-Y coordinates of the arc.
end – The ending X-Y coordinates of the arc.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“arc”).
- class edea.kicad.common.XY
Bases:
KicadExpr
A 2D coordinate point.
- Parameters:
x – The X coordinate of the point.
y – The Y coordinate of the point.
- class edea.kicad.common.Pts
Bases:
KicadExpr
A collection of points and arcs.
KiCad coordinate point list, KiCad arc
- Parameters:
xys – A list of XY instances representing points.
arcs – A list of PolygonArc instances representing arcs.
- xys: list[XY]
- arcs: list[PolygonArc]
- classmethod from_list(exprs: list[str | QuotedStr | list[str | QuotedStr | SExprList]]) Self
Turns an s-expression list of arguments into an EDeA dataclass. Note that you omit the tag name in the s-expression so e.g. for (symbol “foo” (pin 1)) you would pass [“foo”, [“pin”, 1]] to this method.
- Returns:
An instance of the ‘KicadExpr’ created from the KiCad expression data.
- to_list() list[str | QuotedStr | list[str | QuotedStr | SExprList]]
Turns a a KicadExpr into an s-expression list. Note that the initial keyword is omitted in the return of this function. It can be retrieved by accessing .kicad_expr_tag_name.
- Returns:
A list representing the KiCad expression data structure generated from the object.
- class edea.kicad.common.Image(at: tuple[float, float], scale: float | None = None, uuid: ~uuid.UUID = <factory>, data: list[str] = <factory>)
Bases:
KicadExpr
An embedded image in a KiCad expression.
- Parameters:
at – The X-Y coordinates specifying the image placement.
scale – The scale factor of the image.
uuid – The unique identifier (UUID) for the image.
data – The image data in the portable network graphics format (PNG) encoded with MIME type base64.
- class edea.kicad.common.TitleBlockComment(number: Annotated[int, 'kicad_no_kw'] = 1, text: Annotated[str, 'kicad_no_kw', 'kicad_always_quotes'] = '')
Bases:
KicadExpr
A comment within a KiCad title block.
- Parameters:
number – A sequential comment number.
text – The comment text content.
- Variables:
kicad_expr_tag_name – The KiCad expression tag name for this element (“comment”).
- class edea.kicad.common.TitleBlock(title: ~typing.Annotated[str, ('kicad_omits_default',)] = '', date: ~typing.Annotated[str, ('kicad_omits_default',)] = '', rev: ~typing.Annotated[str, ('kicad_omits_default',)] = '', company: ~typing.Annotated[str, ('kicad_omits_default',)] = '', comments: ~typing.Annotated[list[~edea.kicad.common.TitleBlockComment], ('kicad_omits_default',)] = <factory>)
Bases:
KicadExpr
The contents of a KiCad title block.
- Parameters:
title – The title of the document.
date – The document date using the YYYY-MM-DD format.
rev – The revision number of the document.
company – The company name associated with the document.
comments – The document comments where N is a number from 1 to 9 and COMMENT is a quoted string.
- comments: Annotated[list[TitleBlockComment], 'kicad_omits_default']
- class edea.kicad.common.Font(face: str | None = None, size: tuple[float, float] = (1.27, 1.27), thickness: Annotated[float | None, 'kicad_omits_default'] = None, bold: Annotated[bool, 'kicad_kw_bool'] = False, italic: Annotated[bool, 'kicad_kw_bool'] = False, color: Annotated[tuple[int, int, int, float], 'kicad_omits_default'] = (0, 0, 0, 1.0))
Bases:
KicadExpr
The font style for KiCad expressions.
- Parameters:
face – The font face name. Defaults to None.
size – The font size (width, height) in KiCad units. Defaults to (1.27, 1.27).
thickness – The font thickness.
bold – Whether the font is bold or not.
italic – Whether the font is italic or not.
color – The font color as a 4-tuple of integers (R, G, B, A).
- class edea.kicad.common.Effects(font: ~edea.kicad.common.Font = <factory>, justify: ~typing.Annotated[list[~typing.Literal['left', 'right', 'top', 'bottom', 'mirror']], ('kicad_omits_default',)] = <factory>, hide: ~typing.Annotated[bool, ('kicad_kw_bool',)] = False, href: ~typing.Annotated[str | None, ('kicad_always_quotes',)] = None)
Bases:
KicadExpr
The text effects for KiCad expressions.
- Parameters:
font – How the text is shown.
justify – Text justified horizontally right or left and/or vertically top or bottom and/or mirrored.
hide – Whether to hide the text element or not.
href – A hyperlink reference.
- font: Font