alhambra.drawing#

Module Contents#

Classes#

DrawingElement

Helper class that provides a standard way to create an ABC using

XMLElement

Helper class that provides a standard way to create an ABC using

Group

Helper class that provides a standard way to create an ABC using

Rectangle

Helper class that provides a standard way to create an ABC using

Text

Helper class that provides a standard way to create an ABC using

Use

Helper class that provides a standard way to create an ABC using

Drawing

Helper class that provides a standard way to create an ABC using

Attributes#

Number

alhambra.drawing.Number: typing_extensions.TypeAlias[source]#
class alhambra.drawing.DrawingElement[source]#

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstract to_xml() xml.etree.ElementTree.Element[source]#
class alhambra.drawing.XMLElement(tag, attrib={}, **extra)[source]#

Bases: DrawingElement, xml.etree.ElementTree.Element

Helper class that provides a standard way to create an ABC using inheritance.

to_xml() xml.etree.ElementTree.Element[source]#
class alhambra.drawing.Group[source]#

Bases: DrawingElement

Helper class that provides a standard way to create an ABC using inheritance.

elements: list[DrawingElement][source]#
id: str | None[source]#
to_xml() xml.etree.ElementTree.Element[source]#
append(v: DrawingElement) None[source]#
class alhambra.drawing.Rectangle(x: Number = 0, y: Number = 0, width: Number = 1, height: Number = 1, /, **kwargs)[source]#

Bases: DrawingElement

Helper class that provides a standard way to create an ABC using inheritance.

_el: xml.etree.ElementTree.Element[source]#
to_xml()[source]#
class alhambra.drawing.Text(text: str, size: Number = 10, x: Number = 0, y: Number = 0, /, **kwargs)[source]#

Bases: DrawingElement

Helper class that provides a standard way to create an ABC using inheritance.

_el: xml.etree.ElementTree.Element[source]#
to_xml()[source]#
class alhambra.drawing.Use(id_or_link: str | Any, x: Number = 0, y: Number = 0, /, **kwargs)[source]#

Bases: DrawingElement

Helper class that provides a standard way to create an ABC using inheritance.

_el: xml.etree.ElementTree.Element[source]#
to_xml()[source]#
class alhambra.drawing.Drawing[source]#

Bases: DrawingElement

Helper class that provides a standard way to create an ABC using inheritance.

width: int[source]#
height: int[source]#
defs: list[DrawingElement][source]#
elements: list[DrawingElement][source]#
viewBox: tuple[Number, Number, Number, Number] | None[source]#
saveSvg[source]#
to_xml() xml.etree.ElementTree.Element[source]#
save_svg(filename: str)[source]#
to_et() xml.etree.ElementTree.ElementTree[source]#
to_string() str[source]#
to_bytes() bytes[source]#
_repr_svg_()[source]#
_repr_html_()[source]#