{ "module": "omniread.xlsx", "content": { "path": "omniread.xlsx", "docstring": "# Summary\n\nXLSX subpackage for OmniRead.\n\nProvides acquisition and parsing of Office Open XML spreadsheet (xlsx)\ncontent:\n\n- `BaseXlsxClient`: abstract backing-store client for xlsx bytes.\n- `FileSystemXlsxClient`: local filesystem implementation.\n- `XlsxScraper`: wraps fetched bytes into canonical `Content`.\n- `XlsxParserBase`: content-type-enforcing parser contract.\n- `XlsxParser`: generic string-row parser built on openpyxl.", "objects": { "BaseXlsxClient": { "name": "BaseXlsxClient", "kind": "class", "path": "omniread.xlsx.BaseXlsxClient", "signature": null, "docstring": "Abstract client responsible for retrieving spreadsheet bytes.\n\nRetrieves bytes from a specific backing store (filesystem, S3, FTP, etc.).\n\nNotes:\n **Responsibilities:**\n\n - Implementations must accept a source identifier appropriate to\n the backing store.\n - Return the full xlsx binary payload.\n - Raise retrieval-specific errors on failure.", "members": { "fetch": { "name": "fetch", "kind": "function", "path": "omniread.xlsx.BaseXlsxClient.fetch", "signature": "fetch(source: Any)", "docstring": "Fetch raw xlsx bytes from the given source.\n\nArgs:\n source (Any):\n Identifier of the spreadsheet location, such as a file path,\n object storage key, or remote reference.\n\nReturns:\n bytes:\n Raw xlsx bytes.\n\nRaises:\n Exception:\n Retrieval-specific errors defined by the implementation." } } }, "FileSystemXlsxClient": { "name": "FileSystemXlsxClient", "kind": "class", "path": "omniread.xlsx.FileSystemXlsxClient", "signature": null, "docstring": "XLSX client that reads from the local filesystem.\n\nNotes:\n **Guarantees:**\n\n - This client reads spreadsheet files directly from the disk and\n returns their raw binary contents.", "members": { "fetch": { "name": "fetch", "kind": "function", "path": "omniread.xlsx.FileSystemXlsxClient.fetch", "signature": "fetch(path: Path)", "docstring": "Read an xlsx file from the local filesystem.\n\nArgs:\n path (Path):\n Filesystem path to the spreadsheet file.\n\nReturns:\n bytes:\n Raw xlsx bytes.\n\nRaises:\n FileNotFoundError:\n If the path does not exist.\n ValueError:\n If the path exists but is not a file." } } }, "XlsxParser": { "name": "XlsxParser", "kind": "class", "path": "omniread.xlsx.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.XlsxParser.workbook", "signature": null, "docstring": "The lazily loaded workbook backing this parser's content." }, "sheet_names": { "name": "sheet_names", "kind": "attribute", "path": "omniread.xlsx.XlsxParser.sheet_names", "signature": null, "docstring": "Names of all worksheets contained in the workbook." }, "parse": { "name": "parse", "kind": "function", "path": "omniread.xlsx.XlsxParser.parse", "signature": "parse()", "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.XlsxParser.rows", "signature": "rows(sheet: int | str | None = None, *, skip_empty: bool = True)", "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." } } }, "XlsxParserBase": { "name": "XlsxParserBase", "kind": "class", "path": "omniread.xlsx.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.XlsxParserBase.supported_types", "signature": null, "docstring": "Set of content types supported by this parser (XLSX only)." }, "parse": { "name": "parse", "kind": "function", "path": "omniread.xlsx.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." } } }, "XlsxScraper": { "name": "XlsxScraper", "kind": "class", "path": "omniread.xlsx.XlsxScraper", "signature": "XlsxScraper(*, client: BaseXlsxClient)", "docstring": "Scraper for xlsx spreadsheet documents.\n\nNotes:\n **Responsibilities:**\n\n - Fetch raw xlsx bytes via the configured client.\n - Wrap the payload in a canonical `Content` instance with the\n XLSX content type and source identifier.\n\n **Constraints:**\n\n - The scraper does not perform parsing or interpretation.\n - Does not assume a specific storage backend.", "members": { "fetch": { "name": "fetch", "kind": "function", "path": "omniread.xlsx.XlsxScraper.fetch", "signature": "fetch(source: Any, *, metadata: Mapping[str, Any] | None = None)", "docstring": "Fetch an xlsx document from the given source.\n\nArgs:\n source (Any):\n Identifier of the spreadsheet source as understood by the\n configured client.\n metadata (Mapping[str, Any] | None, optional):\n Optional metadata to attach to the returned content.\n\nReturns:\n Content:\n A `Content` instance containing raw xlsx bytes, source\n identifier, XLSX content type, and optional metadata.\n\nRaises:\n Exception:\n Retrieval-specific errors raised by the client." } } }, "client": { "name": "client", "kind": "module", "path": "omniread.xlsx.client", "signature": null, "docstring": "# Summary\n\nXLSX client abstractions for OmniRead.\n\nThis module defines the **client layer** responsible for retrieving raw\nOffice Open XML spreadsheet bytes from a concrete backing store.\n\nClients provide low-level access to xlsx binaries and are intentionally\ndecoupled from scraping and parsing logic. They do not perform validation,\ninterpretation, or content extraction.\n\nTypical backing stores include:\n\n- Local filesystems\n- Object storage (S3, GCS, etc.)\n- Network file systems", "members": { "BaseXlsxClient": { "name": "BaseXlsxClient", "kind": "class", "path": "omniread.xlsx.client.BaseXlsxClient", "signature": null, "docstring": "Abstract client responsible for retrieving spreadsheet bytes.\n\nRetrieves bytes from a specific backing store (filesystem, S3, FTP, etc.).\n\nNotes:\n **Responsibilities:**\n\n - Implementations must accept a source identifier appropriate to\n the backing store.\n - Return the full xlsx binary payload.\n - Raise retrieval-specific errors on failure.", "members": { "fetch": { "name": "fetch", "kind": "function", "path": "omniread.xlsx.client.BaseXlsxClient.fetch", "signature": "fetch(source: Any) -> bytes", "docstring": "Fetch raw xlsx bytes from the given source.\n\nArgs:\n source (Any):\n Identifier of the spreadsheet location, such as a file path,\n object storage key, or remote reference.\n\nReturns:\n bytes:\n Raw xlsx bytes.\n\nRaises:\n Exception:\n Retrieval-specific errors defined by the implementation." } } }, "FileSystemXlsxClient": { "name": "FileSystemXlsxClient", "kind": "class", "path": "omniread.xlsx.client.FileSystemXlsxClient", "signature": null, "docstring": "XLSX client that reads from the local filesystem.\n\nNotes:\n **Guarantees:**\n\n - This client reads spreadsheet files directly from the disk and\n returns their raw binary contents.", "members": { "fetch": { "name": "fetch", "kind": "function", "path": "omniread.xlsx.client.FileSystemXlsxClient.fetch", "signature": "fetch(path: Path) -> bytes", "docstring": "Read an xlsx file from the local filesystem.\n\nArgs:\n path (Path):\n Filesystem path to the spreadsheet file.\n\nReturns:\n bytes:\n Raw xlsx bytes.\n\nRaises:\n FileNotFoundError:\n If the path does not exist.\n ValueError:\n If the path exists but is not a file." } } } } }, "parser": { "name": "parser", "kind": "module", "path": "omniread.xlsx.parser", "signature": null, "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.", "members": { "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." } } } } }, "parser_base": { "name": "parser_base", "kind": "module", "path": "omniread.xlsx.parser_base", "signature": null, "docstring": "# Summary\n\nXLSX parser base implementation for OmniRead.\n\nThis module defines the **XLSX-specific parser contract**, extending the\nformat-agnostic `BaseParser` with constraints appropriate for Office Open\nXML spreadsheet content.", "members": { "ContentType": { "name": "ContentType", "kind": "class", "path": "omniread.xlsx.parser_base.ContentType", "signature": null, "docstring": "Supported MIME types for extracted content.\n\nNotes:\n **Guarantees:**\n\n - This enum represents the declared or inferred media type of the\n content source.\n - It is primarily used for routing content to the appropriate\n parser or downstream consumer.", "members": { "HTML": { "name": "HTML", "kind": "attribute", "path": "omniread.xlsx.parser_base.ContentType.HTML", "signature": null, "docstring": "HTML document content." }, "PDF": { "name": "PDF", "kind": "attribute", "path": "omniread.xlsx.parser_base.ContentType.PDF", "signature": null, "docstring": "PDF document content." }, "XLSX": { "name": "XLSX", "kind": "attribute", "path": "omniread.xlsx.parser_base.ContentType.XLSX", "signature": null, "docstring": "Office Open XML spreadsheet (xlsx/xlsm) content." }, "CSV": { "name": "CSV", "kind": "attribute", "path": "omniread.xlsx.parser_base.ContentType.CSV", "signature": null, "docstring": "Comma-separated-value document content." }, "JSON": { "name": "JSON", "kind": "attribute", "path": "omniread.xlsx.parser_base.ContentType.JSON", "signature": null, "docstring": "JSON document content." }, "XML": { "name": "XML", "kind": "attribute", "path": "omniread.xlsx.parser_base.ContentType.XML", "signature": null, "docstring": "XML document content." } } }, "BaseParser": { "name": "BaseParser", "kind": "class", "path": "omniread.xlsx.parser_base.BaseParser", "signature": "BaseParser(content: Content)", "docstring": "Base interface for all parsers.\n\nNotes:\n **Guarantees:**\n\n - A parser is a self-contained object that owns the `Content` it is\n responsible for interpreting.\n - Consumers may rely on early validation of content compatibility\n and type-stable return values from `parse()`.\n\n **Responsibilities:**\n\n - Implementations must declare supported content types via `supported_types`.\n - Implementations must raise parsing-specific exceptions from `parse()`.\n - Implementations must remain deterministic for a given input.", "members": { "supported_types": { "name": "supported_types", "kind": "attribute", "path": "omniread.xlsx.parser_base.BaseParser.supported_types", "signature": null, "docstring": "Set of content types supported by this parser. An empty set indicates that the parser is content-type agnostic." }, "content": { "name": "content", "kind": "attribute", "path": "omniread.xlsx.parser_base.BaseParser.content", "signature": null, "docstring": null }, "parse": { "name": "parse", "kind": "function", "path": "omniread.xlsx.parser_base.BaseParser.parse", "signature": "parse()", "docstring": "Parse the owned content into structured output.\n\nReturns:\n T:\n Parsed, structured representation.\n\nRaises:\n Exception:\n Parsing-specific errors as defined by the implementation.\n\nNotes:\n **Responsibilities:**\n\n - Implementations must fully consume the provided content and\n return a deterministic, structured output." }, "supports": { "name": "supports", "kind": "function", "path": "omniread.xlsx.parser_base.BaseParser.supports", "signature": "supports()", "docstring": "Check whether this parser supports the content's type.\n\nReturns:\n bool:\n True if the content type is supported; False otherwise." } } }, "T": { "name": "T", "kind": "attribute", "path": "omniread.xlsx.parser_base.T", "signature": null, "docstring": null }, "XlsxParserBase": { "name": "XlsxParserBase", "kind": "class", "path": "omniread.xlsx.parser_base.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_base.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_base.XlsxParserBase.parse", "signature": "parse() -> T", "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." } } } } }, "scraper": { "name": "scraper", "kind": "module", "path": "omniread.xlsx.scraper", "signature": null, "docstring": "# Summary\n\nXLSX scraper for OmniRead.\n\nThis module defines the scraper responsible for acquiring raw Office Open\nXML spreadsheet content from a backing store via a configured client.\n\nThe scraper does not interpret or parse the acquired bytes; it wraps them in\nthe canonical `Content` model.", "members": { "Content": { "name": "Content", "kind": "class", "path": "omniread.xlsx.scraper.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.scraper.Content.raw", "signature": null, "docstring": "Raw content bytes as retrieved from the source." }, "source": { "name": "source", "kind": "attribute", "path": "omniread.xlsx.scraper.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.scraper.Content.content_type", "signature": null, "docstring": "Optional MIME type of the content, if known." }, "metadata": { "name": "metadata", "kind": "attribute", "path": "omniread.xlsx.scraper.Content.metadata", "signature": null, "docstring": "Optional, implementation-defined metadata associated with the content (e.g., headers, encoding hints, extraction notes)." } } }, "ContentType": { "name": "ContentType", "kind": "class", "path": "omniread.xlsx.scraper.ContentType", "signature": null, "docstring": "Supported MIME types for extracted content.\n\nNotes:\n **Guarantees:**\n\n - This enum represents the declared or inferred media type of the\n content source.\n - It is primarily used for routing content to the appropriate\n parser or downstream consumer.", "members": { "HTML": { "name": "HTML", "kind": "attribute", "path": "omniread.xlsx.scraper.ContentType.HTML", "signature": null, "docstring": "HTML document content." }, "PDF": { "name": "PDF", "kind": "attribute", "path": "omniread.xlsx.scraper.ContentType.PDF", "signature": null, "docstring": "PDF document content." }, "XLSX": { "name": "XLSX", "kind": "attribute", "path": "omniread.xlsx.scraper.ContentType.XLSX", "signature": null, "docstring": "Office Open XML spreadsheet (xlsx/xlsm) content." }, "CSV": { "name": "CSV", "kind": "attribute", "path": "omniread.xlsx.scraper.ContentType.CSV", "signature": null, "docstring": "Comma-separated-value document content." }, "JSON": { "name": "JSON", "kind": "attribute", "path": "omniread.xlsx.scraper.ContentType.JSON", "signature": null, "docstring": "JSON document content." }, "XML": { "name": "XML", "kind": "attribute", "path": "omniread.xlsx.scraper.ContentType.XML", "signature": null, "docstring": "XML document content." } } }, "BaseXlsxClient": { "name": "BaseXlsxClient", "kind": "class", "path": "omniread.xlsx.scraper.BaseXlsxClient", "signature": null, "docstring": "Abstract client responsible for retrieving spreadsheet bytes.\n\nRetrieves bytes from a specific backing store (filesystem, S3, FTP, etc.).\n\nNotes:\n **Responsibilities:**\n\n - Implementations must accept a source identifier appropriate to\n the backing store.\n - Return the full xlsx binary payload.\n - Raise retrieval-specific errors on failure.", "members": { "fetch": { "name": "fetch", "kind": "function", "path": "omniread.xlsx.scraper.BaseXlsxClient.fetch", "signature": "fetch(source: Any)", "docstring": "Fetch raw xlsx bytes from the given source.\n\nArgs:\n source (Any):\n Identifier of the spreadsheet location, such as a file path,\n object storage key, or remote reference.\n\nReturns:\n bytes:\n Raw xlsx bytes.\n\nRaises:\n Exception:\n Retrieval-specific errors defined by the implementation." } } }, "XlsxScraper": { "name": "XlsxScraper", "kind": "class", "path": "omniread.xlsx.scraper.XlsxScraper", "signature": "XlsxScraper(*, client: BaseXlsxClient)", "docstring": "Scraper for xlsx spreadsheet documents.\n\nNotes:\n **Responsibilities:**\n\n - Fetch raw xlsx bytes via the configured client.\n - Wrap the payload in a canonical `Content` instance with the\n XLSX content type and source identifier.\n\n **Constraints:**\n\n - The scraper does not perform parsing or interpretation.\n - Does not assume a specific storage backend.", "members": { "fetch": { "name": "fetch", "kind": "function", "path": "omniread.xlsx.scraper.XlsxScraper.fetch", "signature": "fetch(source: Any, *, metadata: Mapping[str, Any] | None = None) -> Content", "docstring": "Fetch an xlsx document from the given source.\n\nArgs:\n source (Any):\n Identifier of the spreadsheet source as understood by the\n configured client.\n metadata (Mapping[str, Any] | None, optional):\n Optional metadata to attach to the returned content.\n\nReturns:\n Content:\n A `Content` instance containing raw xlsx bytes, source\n identifier, XLSX content type, and optional metadata.\n\nRaises:\n Exception:\n Retrieval-specific errors raised by the client." } } } } } } } }