spreadsheet_intelligence.parsers.theme package#

Subpackages#

Submodules#

spreadsheet_intelligence.parsers.theme.theme_xml_parser module#

class spreadsheet_intelligence.parsers.theme.theme_xml_parser.ThemeXMLParser(theme_root: Element)[source]#

Bases: BaseXMLParser

Parses XML theme elements into a Theme object.

namespaces#

XML namespaces used in the theme.

Type:

dict

theme_el_root#

Root element of the theme XML.

Type:

ET.Element

theme#

Parsed theme object.

Type:

Optional[Theme]

namespaces: dict[str, str]#
theme: Theme | None#
parse() Theme[source]#

Parses the theme XML and returns a Theme object.

Returns:

The parsed theme object.

Return type:

Theme

_abc_impl = <_abc._abc_data object>#

Module contents#

class spreadsheet_intelligence.parsers.theme.ThemeXMLParser(theme_root: Element)[source]#

Bases: BaseXMLParser

Parses XML theme elements into a Theme object.

namespaces#

XML namespaces used in the theme.

Type:

dict

theme_el_root#

Root element of the theme XML.

Type:

ET.Element

theme#

Parsed theme object.

Type:

Optional[Theme]

_abc_impl = <_abc._abc_data object>#
parse() Theme[source]#

Parses the theme XML and returns a Theme object.

Returns:

The parsed theme object.

Return type:

Theme

theme: Theme | None#
namespaces: dict[str, str]#
class spreadsheet_intelligence.parsers.theme.ThemeParser(namespaces: dict[str, str])[source]#

Bases: BaseParser

Parser for theme elements in a spreadsheet.

This class is responsible for parsing XML elements related to themes and converting them into Theme objects.

namespaces#

A dictionary of XML namespaces.

Type:

dict[str, str]

_abc_impl = <_abc._abc_data object>#
_parse_clr_scheme(element: Element) ClrScheme[source]#

Parses a color scheme element and returns a ClrScheme object.

Parameters:

element (ET.Element) – The XML element representing the color scheme.

Returns:

The parsed ClrScheme object.

Return type:

ClrScheme

parse(element: Element) Theme[source]#

Parses a theme element and returns a Theme object.

Parameters:

element (ET.Element) – The XML element to parse.

Returns:

The parsed Theme object.

Return type:

Theme