spreadsheet_intelligence.core package#

Submodules#

spreadsheet_intelligence.core.base_loader module#

class spreadsheet_intelligence.core.base_loader.BaseLoader(file_path: str)[source]#

Bases: ABC

Abstract base class for core loader.

file_path#

The path to the file to be loaded.

Type:

str

abstractmethod load()[source]#

Abstract method to load the file. This method should be implemented by subclasses.

_abc_impl = <_abc._abc_data object>#

spreadsheet_intelligence.core.excel_autoshape_loader module#

class spreadsheet_intelligence.core.excel_autoshape_loader.ExcelAutoshapeLoader(file_path: str)[source]#

Bases: BaseLoader

A loader class for extracting and converting autoshapes from an Excel file.

file_path#

Path to the Excel file.

Type:

str

drawing_xml_path#

Path to the drawing XML within the Excel file.

Type:

str

theme_xml_path#

Path to the theme XML within the Excel file.

Type:

str

xml_contents#

In-memory XML contents of the specified files.

Type:

dict

drawing_root#

Root element of the drawing XML.

Type:

Element

theme_root#

Root element of the theme XML.

Type:

Element

connector_list#

List of raw connector data.

Type:

list[ConnectorAnchorRaw]

shape_list#

List of raw shape data.

Type:

list[ShapeAnchorRaw]

theme#

Parsed theme data.

Type:

Optional[Theme]

converted_connector_list#

List of converted connectors.

Type:

list[BentConnector3]

converted_shape_list#

List of converted shapes.

Type:

list[Shape]

id_counter#

Counter for assigning unique IDs to converted elements.

Type:

int

_parse()[source]#

Parses the drawing and theme XML files to extract raw shape and connector data.

_convert()[source]#

Converts raw shape and connector data into structured objects.

_format()[source]#

Generates a prompt from the converted shapes and connectors.

load()[source]#

Loads and processes the Excel autoshapes by parsing, converting, and generating prompts.

export() str[source]#

Exports the generated prompt as a JSON string.

Returns:

The JSON string of the prompt.

Return type:

str

plot_for_debug()[source]#

Plots the converted shapes and connectors for debugging purposes.

_abc_impl = <_abc._abc_data object>#

Module contents#

class spreadsheet_intelligence.core.BaseLoader(file_path: str)[source]#

Bases: ABC

Abstract base class for core loader.

file_path#

The path to the file to be loaded.

Type:

str

_abc_impl = <_abc._abc_data object>#
abstractmethod load()[source]#

Abstract method to load the file. This method should be implemented by subclasses.

class spreadsheet_intelligence.core.ExcelAutoshapeLoader(file_path: str)[source]#

Bases: BaseLoader

A loader class for extracting and converting autoshapes from an Excel file.

file_path#

Path to the Excel file.

Type:

str

drawing_xml_path#

Path to the drawing XML within the Excel file.

Type:

str

theme_xml_path#

Path to the theme XML within the Excel file.

Type:

str

xml_contents#

In-memory XML contents of the specified files.

Type:

dict

drawing_root#

Root element of the drawing XML.

Type:

Element

theme_root#

Root element of the theme XML.

Type:

Element

connector_list#

List of raw connector data.

Type:

list[ConnectorAnchorRaw]

shape_list#

List of raw shape data.

Type:

list[ShapeAnchorRaw]

theme#

Parsed theme data.

Type:

Optional[Theme]

converted_connector_list#

List of converted connectors.

Type:

list[BentConnector3]

converted_shape_list#

List of converted shapes.

Type:

list[Shape]

id_counter#

Counter for assigning unique IDs to converted elements.

Type:

int

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

Converts raw shape and connector data into structured objects.

_format()[source]#

Generates a prompt from the converted shapes and connectors.

_parse()[source]#

Parses the drawing and theme XML files to extract raw shape and connector data.

export() str[source]#

Exports the generated prompt as a JSON string.

Returns:

The JSON string of the prompt.

Return type:

str

load()[source]#

Loads and processes the Excel autoshapes by parsing, converting, and generating prompts.

plot_for_debug()[source]#

Plots the converted shapes and connectors for debugging purposes.

connector_list: list[ConnectorAnchorRaw]#
shape_list: list[ShapeAnchorRaw]#
theme: Theme | None#
converted_connector_list: list[BentConnector3]#
converted_shape_list: list[Shape]#