all2md.parsers.ods_spreadsheet
ODS spreadsheet to AST converter.
This module provides conversion from ODS (OpenDocument Spreadsheet) files to AST representation. It replaces the combined spreadsheet parser with a focused ODS parser.
- class all2md.parsers.ods_spreadsheet.OdsSpreadsheetToAstConverter
Bases:
BaseParserConvert ODS spreadsheet files to AST representation.
This converter handles ODS (OpenDocument Spreadsheet) format by building Table nodes from spreadsheet data.
- Parameters:
options (OdsSpreadsheetOptions or None) – Conversion options
Initialize the ODS spreadsheet parser with options and progress callback.
- __init__(options: OdsSpreadsheetOptions | None = None, progress_callback: Callable[[ProgressEvent], None] | None = None)
Initialize the ODS spreadsheet parser with options and progress callback.
- parse(input_data: str | Path | IO[bytes] | bytes) Document
Parse ODS spreadsheet into an AST.
- Parameters:
input_data (str, Path, IO[bytes], or bytes) – The input ODS file to parse
- Returns:
AST Document node representing the parsed spreadsheet structure
- Return type:
- Raises:
ParsingError – If parsing fails due to invalid format or corruption
DependencyError – If required dependencies are not installed
ValidationError – If input data is invalid or inaccessible
- ods_to_ast(doc: Any) Document
Convert ODS document to AST Document.
- Parameters:
doc (Any) – ODS document object
- Returns:
AST document with table nodes
- Return type:
- extract_metadata(document: Any) DocumentMetadata
Extract metadata from ODS document.
- Parameters:
document (Any) – ODS document object
- Returns:
Extracted metadata
- Return type: