spreadsheet_intelligence.read_data package#

Submodules#

spreadsheet_intelligence.read_data.excel_to_xml module#

spreadsheet_intelligence.read_data.excel_to_xml.convert_xlsx_to_xml_in_memory(xlsx_path: str, target_files: List[str] | None = None, out_dir: str | None = None) Dict[str, Element][source]#

Convert Excel file to XML format and process it in memory

Parameters:
  • xlsx_path (str) – Path to the target Excel file

  • target_files (Optional[List[str]]) – List of target XML file names (to load only the necessary files to reduce memory usage), default is all XML files

Returns:

Dictionary with XML file names as keys and corresponding XML Elements as values

Return type:

Dict[str, ET.Element]

spreadsheet_intelligence.read_data.excel_to_xml.convert_xlsx_to_xml(xlsx_path: str, xml_dir: str) None[source]#

Convert Excel file to XML format

Parameters:
  • xlsx_path (str) – Path to the target Excel file

  • xml_dir (str) – Directory to output the XML format

spreadsheet_intelligence.read_data.xml_loader module#

exception spreadsheet_intelligence.read_data.xml_loader.XMLLoaderError[source]#

Bases: Exception

class spreadsheet_intelligence.read_data.xml_loader.XMLLoader(xml_path: str)[source]#

Bases: object

load_tree() ElementTree[source]#

Load the specified XML file as an ElementTree.

Returns:

Parsed ElementTree object.

Return type:

ElementTree

Raises:

XMLLoaderError – If the file does not exist, access is denied, or a parse error occurs.

get_root() Element[source]#

Get the root element of the XML.

Returns:

Root element

Return type:

Element

Module contents#