{ "module": "omniread.xlsx.parser", "content": { "path": "omniread.xlsx.parser", "docstring": "# Summary\n\nXLSX parser implementations for OmniRead.\n\nThis module provides a concrete, generic parser for Office Open XML\nspreadsheets. It exposes workbook sheets as lists of string rows so\ndownstream consumers can interpret tabular content without depending on\nopenpyxl directly.\n\nThe parser is intentionally statement-agnostic: it performs no header\ndetection or column interpretation beyond basic cell normalization.", "objects": { "Content": { "name": "Content", "kind": "class", "path": "omniread.xlsx.parser.Content", "signature": "Content(raw: bytes, source: str, content_type: ContentType | None = ..., metadata: Mapping[str, Any] | None = ...)", "docstring": "Normalized representation of extracted content.\n\nNotes:\n **Responsibilities:**\n\n - A `Content` instance represents a raw content payload along with\n minimal contextual metadata describing its origin and type.\n - This class is the primary exchange format between scrapers,\n parsers, and downstream consumers.", "members": { "raw": { "name": "raw", "kind": "attribute", "path": "omniread.xlsx.parser.Content.raw", "signature": null, "docstring": "Raw content bytes as retrieved from the source." }, "source": { "name": "source", "kind": "attribute", "path": "omniread.xlsx.parser.Content.source", "signature": null, "docstring": "Identifier of the content origin (URL, file path, or logical name)." }, "content_type": { "name": "content_type", "kind": "attribute", "path": "omniread.xlsx.parser.Content.content_type", "signature": null, "docstring": "Optional MIME type of the content, if known." }, "metadata": { "name": "metadata", "kind": "attribute", "path": "omniread.xlsx.parser.Content.metadata", "signature": null, "docstring": "Optional, implementation-defined metadata associated with the content (e.g., headers, encoding hints, extraction notes)." } } }, "XlsxParserBase": { "name": "XlsxParserBase", "kind": "class", "path": "omniread.xlsx.parser.XlsxParserBase", "signature": null, "docstring": "Base xlsx parser.\n\nNotes:\n **Responsibilities:**\n\n - This class enforces xlsx content-type compatibility and provides\n the extension point for implementing concrete xlsx parsing\n strategies.\n\n **Constraints:**\n\n - Concrete implementations must define the output type `T` and\n implement the `parse()` method.", "members": { "supported_types": { "name": "supported_types", "kind": "attribute", "path": "omniread.xlsx.parser.XlsxParserBase.supported_types", "signature": null, "docstring": "Set of content types supported by this parser (XLSX only)." }, "parse": { "name": "parse", "kind": "function", "path": "omniread.xlsx.parser.XlsxParserBase.parse", "signature": "parse()", "docstring": "Parse xlsx content into a structured output.\n\nReturns:\n T:\n Parsed representation of type `T`.\n\nRaises:\n Exception:\n Parsing-specific errors as defined by the implementation." } } }, "XlsxParser": { "name": "XlsxParser", "kind": "class", "path": "omniread.xlsx.parser.XlsxParser", "signature": "XlsxParser(content: Content, *, data_only: bool = True, read_only: bool = True)", "docstring": "Generic xlsx parser producing string rows from a worksheet.\n\nNotes:\n **Responsibilities:**\n\n - Lazily load the workbook owned by the parser's content.\n - Normalize cells (including dates and numeric values) into\n deterministic string representations.\n - Expose sheet discovery and row extraction helpers.\n\n **Constraints:**\n\n - Cells are rendered with ``str(value)`` after trimming; date and\n datetime values are rendered in ISO format. Consumers requiring\n locale-specific formatting must convert on their side.", "members": { "workbook": { "name": "workbook", "kind": "attribute", "path": "omniread.xlsx.parser.XlsxParser.workbook", "signature": null, "docstring": "The lazily loaded workbook backing this parser's content." }, "sheet_names": { "name": "sheet_names", "kind": "attribute", "path": "omniread.xlsx.parser.XlsxParser.sheet_names", "signature": null, "docstring": "Names of all worksheets contained in the workbook." }, "parse": { "name": "parse", "kind": "function", "path": "omniread.xlsx.parser.XlsxParser.parse", "signature": "parse() -> list[list[str]]", "docstring": "Parse the first worksheet into normalized string rows.\n\nReturns:\n list[list[str]]:\n Rows of the default (first) worksheet." }, "rows": { "name": "rows", "kind": "function", "path": "omniread.xlsx.parser.XlsxParser.rows", "signature": "rows(sheet: int | str | None = None, *, skip_empty: bool = True) -> list[list[str]]", "docstring": "Extract normalized string rows from a worksheet.\n\nArgs:\n sheet (int | str | None):\n Worksheet index or title; defaults to the first worksheet.\n skip_empty (bool):\n When True (default), rows whose cells are all blank are omitted.\n\nReturns:\n list[list[str]]:\n Normalized rows; trailing blank cells are trimmed per row.\n\nRaises:\n ValueError:\n If the requested sheet does not exist." } } } } } }