{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"omniread","text":""},{"location":"#omniread","title":"omniread","text":""},{"location":"#omniread--summary","title":"Summary","text":"

OmniRead \u2014 format-agnostic content acquisition and parsing framework.

OmniRead provides a cleanly layered architecture for fetching, parsing, and normalizing content from heterogeneous sources such as HTML documents and PDF files.

The library is structured around three core concepts:

  1. Content: A canonical, format-agnostic container representing raw content bytes and minimal contextual metadata.
  2. Scrapers: Components responsible for acquiring raw content from a source (HTTP, filesystem, object storage, etc.). Scrapers never interpret content.
  3. Parsers: Components responsible for interpreting acquired content and converting it into structured, typed representations.

OmniRead deliberately separates these responsibilities to ensure:

"},{"location":"#omniread--installation","title":"Installation","text":"

Install OmniRead using pip:

pip install omniread\n

Install OmniRead using Poetry:

poetry add omniread\n

"},{"location":"#omniread--quick-start","title":"Quick start","text":"Example

HTML example:

from omniread import HTMLScraper, HTMLParser\n\nscraper = HTMLScraper()\ncontent = scraper.fetch(\"https://example.com\")\n\nclass TitleParser(HTMLParser[str]):\n    def parse(self) -> str:\n        return self._soup.title.string\n\nparser = TitleParser(content)\ntitle = parser.parse()\n

PDF example:

from omniread import FileSystemPDFClient, PDFScraper, PDFParser\nfrom pathlib import Path\n\nclient = FileSystemPDFClient()\nscraper = PDFScraper(client=client)\ncontent = scraper.fetch(Path(\"document.pdf\"))\n\nclass TextPDFParser(PDFParser[str]):\n    def parse(self) -> str:\n        # implement PDF text extraction\n        ...\n\nparser = TextPDFParser(content)\nresult = parser.parse()\n

"},{"location":"#omniread--public-api","title":"Public API","text":"

This module re-exports the recommended public entry points of OmniRead. Consumers are encouraged to import from this namespace rather than from format-specific submodules directly, unless advanced customization is required.

"},{"location":"#omniread--core-philosophy","title":"Core Philosophy","text":"

OmniRead is designed as a decoupled content engine:

  1. Separation of Concerns: Scrapers fetch, Parsers interpret. Neither knows about the other.
  2. Normalized Exchange: All components communicate via the Content model, ensuring a consistent contract.
  3. Format Agnosticism: The core logic is independent of whether the input is HTML, PDF, or JSON.
"},{"location":"#omniread-classes","title":"Classes","text":""},{"location":"#omniread.Content","title":"Content dataclass","text":"
Content(\n    raw: bytes,\n    source: str,\n    content_type: ContentType | None = ...,\n    metadata: Mapping[str, Any] | None = ...,\n)\n

Normalized representation of extracted content.

Notes

Responsibilities:

- 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.\n
"},{"location":"#omniread.Content-attributes","title":"Attributes","text":""},{"location":"#omniread.Content.content_type","title":"content_type class-attribute instance-attribute","text":"
content_type: ContentType | None = None\n

Optional MIME type of the content, if known.

"},{"location":"#omniread.Content.metadata","title":"metadata class-attribute instance-attribute","text":"
metadata: Mapping[str, Any] | None = None\n

Optional, implementation-defined metadata associated with the content (e.g., headers, encoding hints, extraction notes).

"},{"location":"#omniread.Content.raw","title":"raw instance-attribute","text":"
raw: bytes\n

Raw content bytes as retrieved from the source.

"},{"location":"#omniread.Content.source","title":"source instance-attribute","text":"
source: str\n

Identifier of the content origin (URL, file path, or logical name).

"},{"location":"#omniread.ContentType","title":"ContentType","text":"

Bases: str, Enum

Supported MIME types for extracted content.

Notes

Guarantees:

- 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.\n
"},{"location":"#omniread.ContentType-attributes","title":"Attributes","text":""},{"location":"#omniread.ContentType.CSV","title":"CSV class-attribute instance-attribute","text":"
CSV = 'text/csv'\n

Comma-separated-value document content.

"},{"location":"#omniread.ContentType.HTML","title":"HTML class-attribute instance-attribute","text":"
HTML = 'text/html'\n

HTML document content.

"},{"location":"#omniread.ContentType.JSON","title":"JSON class-attribute instance-attribute","text":"
JSON = 'application/json'\n

JSON document content.

"},{"location":"#omniread.ContentType.PDF","title":"PDF class-attribute instance-attribute","text":"
PDF = 'application/pdf'\n

PDF document content.

"},{"location":"#omniread.ContentType.XLSX","title":"XLSX class-attribute instance-attribute","text":"
XLSX = \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n

Office Open XML spreadsheet (xlsx/xlsm) content.

"},{"location":"#omniread.ContentType.XML","title":"XML class-attribute instance-attribute","text":"
XML = 'application/xml'\n

XML document content.

"},{"location":"#omniread.FileSystemPDFClient","title":"FileSystemPDFClient","text":"

Bases: BasePDFClient

PDF client that reads from the local filesystem.

Notes

Guarantees:

- This client reads PDF files directly from the disk and returns\n  their raw binary contents.\n
"},{"location":"#omniread.FileSystemPDFClient-functions","title":"Functions","text":""},{"location":"#omniread.FileSystemPDFClient.fetch","title":"fetch","text":"
fetch(path: Path) -> bytes\n

Read a PDF file from the local filesystem.

Parameters:

Name Type Description Default path Path

Filesystem path to the PDF file.

required

Returns:

Name Type Description bytes bytes

Raw PDF bytes.

Raises:

Type Description FileNotFoundError

If the path does not exist.

ValueError

If the path exists but is not a file.

"},{"location":"#omniread.HTMLParser","title":"HTMLParser","text":"
HTMLParser(content: Content, features: str = 'html.parser')\n

Bases: BaseParser[T], Generic[T]

Base HTML parser.

Notes

Responsibilities:

- This class extends the core `BaseParser` with HTML-specific behavior,\n  including DOM parsing via BeautifulSoup and reusable extraction helpers.\n- Provides reusable helpers for HTML extraction. Concrete parsers must\n  explicitly define the return type.\n

Guarantees:

- Accepts only HTML content.\n- Owns a parsed BeautifulSoup DOM tree.\n- Provides pure helper utilities for common HTML structures.\n

Constraints:

- Concrete subclasses must define the output type `T` and implement\n  the `parse()` method.\n

Initialize the HTML parser.

Parameters:

Name Type Description Default content Content

HTML content to be parsed.

required features str

BeautifulSoup parser backend to use (e.g., 'html.parser', 'lxml').

'html.parser'

Raises:

Type Description ValueError

If the content is empty or not valid HTML.

"},{"location":"#omniread.HTMLParser-attributes","title":"Attributes","text":""},{"location":"#omniread.HTMLParser.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = {HTML}\n

Set of content types supported by this parser (HTML only).

"},{"location":"#omniread.HTMLParser-functions","title":"Functions","text":""},{"location":"#omniread.HTMLParser.parse","title":"parse abstractmethod","text":"
parse() -> T\n

Fully parse the HTML content into structured output.

Returns:

Name Type Description T T

Parsed representation of type T.

Notes

Responsibilities:

- Implementations must fully interpret the HTML DOM and return a\n  deterministic, structured output.\n
"},{"location":"#omniread.HTMLParser.parse_div","title":"parse_div staticmethod","text":"
parse_div(div: Tag, *, separator: str = ' ') -> str\n

Extract normalized text from a <div> element.

Parameters:

Name Type Description Default div Tag

BeautifulSoup tag representing a <div>.

required separator str

String used to separate text nodes.

' '

Returns:

Name Type Description str str

Flattened, whitespace-normalized text content.

"},{"location":"#omniread.HTMLParser.parse_link","title":"parse_link staticmethod","text":"
parse_link(a: Tag) -> str | None\n

Extract the hyperlink reference from an <a> element.

Parameters:

Name Type Description Default a Tag

BeautifulSoup tag representing an anchor.

required

Returns:

Type Description str | None

str | None: The value of the href attribute, or None if absent.

"},{"location":"#omniread.HTMLParser.parse_meta","title":"parse_meta","text":"
parse_meta() -> dict[str, Any]\n

Extract high-level metadata from the HTML document.

Returns:

Type Description dict[str, Any]

dict[str, Any]: Dictionary containing extracted metadata.

Notes

Responsibilities:

- Extract high-level metadata from the HTML document.\n- This includes: Document title, `<meta>` tag name/property to\n  content mappings.\n
"},{"location":"#omniread.HTMLParser.parse_table","title":"parse_table staticmethod","text":"
parse_table(table: Tag) -> list[list[str]]\n

Parse an HTML table into a 2D list of strings.

Parameters:

Name Type Description Default table Tag

BeautifulSoup tag representing a <table>.

required

Returns:

Type Description list[list[str]]

list[list[str]]: A list of rows, where each row is a list of cell text values.

"},{"location":"#omniread.HTMLParser.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"#omniread.HTMLScraper","title":"HTMLScraper","text":"
HTMLScraper(\n    *,\n    client: httpx.Client | None = None,\n    timeout: float = 15.0,\n    headers: Mapping[str, str] | None = None,\n    follow_redirects: bool = True\n)\n

Bases: BaseScraper

Base HTML scraper using httpx.

Notes

Responsibilities:

- This scraper retrieves HTML documents over HTTP(S) and returns\n  them as raw content wrapped in a `Content` object.\n- Fetches raw bytes and metadata only.\n- The scraper uses `httpx.Client` for HTTP requests, enforces an\n  HTML content type, and preserves HTTP response metadata.\n

Constraints:

- The scraper does not: Parse HTML, perform retries or backoff,\n  handle non-HTML responses.\n

Initialize the HTML scraper.

Parameters:

Name Type Description Default client Client | None

Optional pre-configured httpx.Client. If omitted, a client is created internally.

None timeout float

Request timeout in seconds.

15.0 headers Mapping[str, str] | None

Optional default HTTP headers.

None follow_redirects bool

Whether to follow HTTP redirects.

True"},{"location":"#omniread.HTMLScraper-functions","title":"Functions","text":""},{"location":"#omniread.HTMLScraper.fetch","title":"fetch","text":"
fetch(\n    source: str,\n    *,\n    metadata: Mapping[str, Any] | None = None\n) -> Content\n

Fetch an HTML document from the given source.

Parameters:

Name Type Description Default source str

URL of the HTML document.

required metadata Mapping[str, Any] | None

Optional metadata to be merged into the returned content.

None

Returns:

Name Type Description Content Content

A Content instance containing raw HTML bytes, source URL, HTML content type, and HTTP response metadata.

Raises:

Type Description HTTPError

If the HTTP request fails.

ValueError

If the response is not valid HTML.

"},{"location":"#omniread.HTMLScraper.validate_content_type","title":"validate_content_type","text":"
validate_content_type(response: httpx.Response) -> None\n

Validate that the HTTP response contains HTML content.

Parameters:

Name Type Description Default response Response

HTTP response returned by httpx.

required

Raises:

Type Description ValueError

If the Content-Type header is missing or does not indicate HTML content.

"},{"location":"#omniread.PDFParser","title":"PDFParser","text":"
PDFParser(content: Content)\n

Bases: BaseParser[T], Generic[T]

Base PDF parser.

Notes

Responsibilities:

- This class enforces PDF content-type compatibility and provides\n  the extension point for implementing concrete PDF parsing strategies.\n

Constraints:

- Concrete implementations must define the output type `T` and\n  implement the `parse()` method.\n

Initialize the parser with content to be parsed.

Parameters:

Name Type Description Default content Content

Content instance to be parsed.

required

Raises:

Type Description ValueError

If the content type is not supported by this parser.

"},{"location":"#omniread.PDFParser-attributes","title":"Attributes","text":""},{"location":"#omniread.PDFParser.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = {PDF}\n

Set of content types supported by this parser (PDF only).

"},{"location":"#omniread.PDFParser-functions","title":"Functions","text":""},{"location":"#omniread.PDFParser.parse","title":"parse abstractmethod","text":"
parse() -> T\n

Parse PDF content into a structured output.

Returns:

Name Type Description T T

Parsed representation of type T.

Raises:

Type Description Exception

Parsing-specific errors as defined by the implementation.

Notes

Responsibilities:

- Implementations must fully interpret the PDF binary payload and\n  return a deterministic, structured output.\n
"},{"location":"#omniread.PDFParser.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"#omniread.PDFScraper","title":"PDFScraper","text":"
PDFScraper(*, client: BasePDFClient)\n

Bases: BaseScraper

Scraper for PDF sources.

Notes

Responsibilities:

- Delegates byte retrieval to a PDF client and normalizes output\n  into `Content`.\n- Preserves caller-provided metadata.\n

Constraints:

- The scraper does not perform parsing or interpretation.\n- Does not assume a specific storage backend.\n

Initialize the PDF scraper.

Parameters:

Name Type Description Default client BasePDFClient

PDF client responsible for retrieving raw PDF bytes.

required"},{"location":"#omniread.PDFScraper-functions","title":"Functions","text":""},{"location":"#omniread.PDFScraper.fetch","title":"fetch","text":"
fetch(\n    source: Any,\n    *,\n    metadata: Mapping[str, Any] | None = None\n) -> Content\n

Fetch a PDF document from the given source.

Parameters:

Name Type Description Default source Any

Identifier of the PDF source as understood by the configured PDF client.

required metadata Mapping[str, Any] | None

Optional metadata to attach to the returned content.

None

Returns:

Name Type Description Content Content

A Content instance containing raw PDF bytes, source identifier, PDF content type, and optional metadata.

Raises:

Type Description Exception

Retrieval-specific errors raised by the PDF client.

"},{"location":"core/","title":"Core","text":""},{"location":"core/#omniread.core","title":"omniread.core","text":""},{"location":"core/#omniread.core--summary","title":"Summary","text":"

Core domain contracts for OmniRead.

This package defines the format-agnostic domain layer of OmniRead. It exposes canonical content models and abstract interfaces that are implemented by format-specific modules (HTML, PDF, etc.).

Public exports from this package are considered stable contracts and are safe for downstream consumers to depend on.

Submodules:

Format-specific behavior must not be introduced at this layer.

"},{"location":"core/#omniread.core--public-api","title":"Public API","text":""},{"location":"core/#omniread.core-classes","title":"Classes","text":""},{"location":"core/#omniread.core.BaseParser","title":"BaseParser","text":"
BaseParser(content: Content)\n

Bases: ABC, Generic[T]

Base interface for all parsers.

Notes

Guarantees:

- 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

Responsibilities:

- 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.\n

Initialize the parser with content to be parsed.

Parameters:

Name Type Description Default content Content

Content instance to be parsed.

required

Raises:

Type Description ValueError

If the content type is not supported by this parser.

"},{"location":"core/#omniread.core.BaseParser-attributes","title":"Attributes","text":""},{"location":"core/#omniread.core.BaseParser.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = set()\n

Set of content types supported by this parser. An empty set indicates that the parser is content-type agnostic.

"},{"location":"core/#omniread.core.BaseParser-functions","title":"Functions","text":""},{"location":"core/#omniread.core.BaseParser.parse","title":"parse abstractmethod","text":"
parse() -> T\n

Parse the owned content into structured output.

Returns:

Name Type Description T T

Parsed, structured representation.

Raises:

Type Description Exception

Parsing-specific errors as defined by the implementation.

Notes

Responsibilities:

- Implementations must fully consume the provided content and\n  return a deterministic, structured output.\n
"},{"location":"core/#omniread.core.BaseParser.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"core/#omniread.core.BaseScraper","title":"BaseScraper","text":"

Bases: ABC

Base interface for all scrapers.

Notes

Responsibilities:

- A scraper is responsible ONLY for fetching raw content (bytes)\n  from a source. It must not interpret or parse it.\n- A scraper is a stateless acquisition component that retrieves raw\n  content from a source and returns it as a `Content` object.\n- Scrapers define how content is obtained, not what the content means.\n- Implementations may vary in transport mechanism, authentication\n  strategy, retry and backoff behavior.\n

Constraints:

- Implementations must not parse content, modify content semantics,\n  or couple scraping logic to a specific parser.\n
"},{"location":"core/#omniread.core.BaseScraper-functions","title":"Functions","text":""},{"location":"core/#omniread.core.BaseScraper.fetch","title":"fetch abstractmethod","text":"
fetch(\n    source: str,\n    *,\n    metadata: Mapping[str, Any] | None = None\n) -> Content\n

Fetch raw content from the given source.

Parameters:

Name Type Description Default source str

Location identifier (URL, file path, S3 URI, etc.).

required metadata Mapping[str, Any] | None

Optional hints for the scraper (headers, auth, etc.).

None

Returns:

Name Type Description Content Content

Content object containing raw bytes and metadata.

Raises:

Type Description Exception

Retrieval-specific errors as defined by the implementation.

Notes

Responsibilities:

- Implementations must retrieve the content referenced by `source`\n  and return it as raw bytes wrapped in a `Content` object.\n
"},{"location":"core/#omniread.core.Content","title":"Content dataclass","text":"
Content(\n    raw: bytes,\n    source: str,\n    content_type: ContentType | None = ...,\n    metadata: Mapping[str, Any] | None = ...,\n)\n

Normalized representation of extracted content.

Notes

Responsibilities:

- 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.\n
"},{"location":"core/#omniread.core.Content-attributes","title":"Attributes","text":""},{"location":"core/#omniread.core.Content.content_type","title":"content_type class-attribute instance-attribute","text":"
content_type: ContentType | None = None\n

Optional MIME type of the content, if known.

"},{"location":"core/#omniread.core.Content.metadata","title":"metadata class-attribute instance-attribute","text":"
metadata: Mapping[str, Any] | None = None\n

Optional, implementation-defined metadata associated with the content (e.g., headers, encoding hints, extraction notes).

"},{"location":"core/#omniread.core.Content.raw","title":"raw instance-attribute","text":"
raw: bytes\n

Raw content bytes as retrieved from the source.

"},{"location":"core/#omniread.core.Content.source","title":"source instance-attribute","text":"
source: str\n

Identifier of the content origin (URL, file path, or logical name).

"},{"location":"core/#omniread.core.ContentType","title":"ContentType","text":"

Bases: str, Enum

Supported MIME types for extracted content.

Notes

Guarantees:

- 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.\n
"},{"location":"core/#omniread.core.ContentType-attributes","title":"Attributes","text":""},{"location":"core/#omniread.core.ContentType.CSV","title":"CSV class-attribute instance-attribute","text":"
CSV = 'text/csv'\n

Comma-separated-value document content.

"},{"location":"core/#omniread.core.ContentType.HTML","title":"HTML class-attribute instance-attribute","text":"
HTML = 'text/html'\n

HTML document content.

"},{"location":"core/#omniread.core.ContentType.JSON","title":"JSON class-attribute instance-attribute","text":"
JSON = 'application/json'\n

JSON document content.

"},{"location":"core/#omniread.core.ContentType.PDF","title":"PDF class-attribute instance-attribute","text":"
PDF = 'application/pdf'\n

PDF document content.

"},{"location":"core/#omniread.core.ContentType.XLSX","title":"XLSX class-attribute instance-attribute","text":"
XLSX = \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n

Office Open XML spreadsheet (xlsx/xlsm) content.

"},{"location":"core/#omniread.core.ContentType.XML","title":"XML class-attribute instance-attribute","text":"
XML = 'application/xml'\n

XML document content.

"},{"location":"core/content/","title":"Content","text":""},{"location":"core/content/#omniread.core.content","title":"omniread.core.content","text":""},{"location":"core/content/#omniread.core.content--summary","title":"Summary","text":"

Canonical content models for OmniRead.

This module defines the format-agnostic content representation used across all parsers and scrapers in OmniRead.

The models defined here represent what was extracted, not how it was retrieved or parsed. Format-specific behavior and metadata must not alter the semantic meaning of these models.

"},{"location":"core/content/#omniread.core.content-classes","title":"Classes","text":""},{"location":"core/content/#omniread.core.content.Content","title":"Content dataclass","text":"
Content(\n    raw: bytes,\n    source: str,\n    content_type: ContentType | None = ...,\n    metadata: Mapping[str, Any] | None = ...,\n)\n

Normalized representation of extracted content.

Notes

Responsibilities:

- 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.\n
"},{"location":"core/content/#omniread.core.content.Content-attributes","title":"Attributes","text":""},{"location":"core/content/#omniread.core.content.Content.content_type","title":"content_type class-attribute instance-attribute","text":"
content_type: ContentType | None = None\n

Optional MIME type of the content, if known.

"},{"location":"core/content/#omniread.core.content.Content.metadata","title":"metadata class-attribute instance-attribute","text":"
metadata: Mapping[str, Any] | None = None\n

Optional, implementation-defined metadata associated with the content (e.g., headers, encoding hints, extraction notes).

"},{"location":"core/content/#omniread.core.content.Content.raw","title":"raw instance-attribute","text":"
raw: bytes\n

Raw content bytes as retrieved from the source.

"},{"location":"core/content/#omniread.core.content.Content.source","title":"source instance-attribute","text":"
source: str\n

Identifier of the content origin (URL, file path, or logical name).

"},{"location":"core/content/#omniread.core.content.ContentType","title":"ContentType","text":"

Bases: str, Enum

Supported MIME types for extracted content.

Notes

Guarantees:

- 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.\n
"},{"location":"core/content/#omniread.core.content.ContentType-attributes","title":"Attributes","text":""},{"location":"core/content/#omniread.core.content.ContentType.CSV","title":"CSV class-attribute instance-attribute","text":"
CSV = 'text/csv'\n

Comma-separated-value document content.

"},{"location":"core/content/#omniread.core.content.ContentType.HTML","title":"HTML class-attribute instance-attribute","text":"
HTML = 'text/html'\n

HTML document content.

"},{"location":"core/content/#omniread.core.content.ContentType.JSON","title":"JSON class-attribute instance-attribute","text":"
JSON = 'application/json'\n

JSON document content.

"},{"location":"core/content/#omniread.core.content.ContentType.PDF","title":"PDF class-attribute instance-attribute","text":"
PDF = 'application/pdf'\n

PDF document content.

"},{"location":"core/content/#omniread.core.content.ContentType.XLSX","title":"XLSX class-attribute instance-attribute","text":"
XLSX = \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n

Office Open XML spreadsheet (xlsx/xlsm) content.

"},{"location":"core/content/#omniread.core.content.ContentType.XML","title":"XML class-attribute instance-attribute","text":"
XML = 'application/xml'\n

XML document content.

"},{"location":"core/parser/","title":"Parser","text":""},{"location":"core/parser/#omniread.core.parser","title":"omniread.core.parser","text":""},{"location":"core/parser/#omniread.core.parser--summary","title":"Summary","text":"

Abstract parsing contracts for OmniRead.

This module defines the format-agnostic parser interface used to transform raw content into structured, typed representations.

Parsers are responsible for:

Parsers are not responsible for:

"},{"location":"core/parser/#omniread.core.parser-classes","title":"Classes","text":""},{"location":"core/parser/#omniread.core.parser.BaseParser","title":"BaseParser","text":"
BaseParser(content: Content)\n

Bases: ABC, Generic[T]

Base interface for all parsers.

Notes

Guarantees:

- 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

Responsibilities:

- 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.\n

Initialize the parser with content to be parsed.

Parameters:

Name Type Description Default content Content

Content instance to be parsed.

required

Raises:

Type Description ValueError

If the content type is not supported by this parser.

"},{"location":"core/parser/#omniread.core.parser.BaseParser-attributes","title":"Attributes","text":""},{"location":"core/parser/#omniread.core.parser.BaseParser.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = set()\n

Set of content types supported by this parser. An empty set indicates that the parser is content-type agnostic.

"},{"location":"core/parser/#omniread.core.parser.BaseParser-functions","title":"Functions","text":""},{"location":"core/parser/#omniread.core.parser.BaseParser.parse","title":"parse abstractmethod","text":"
parse() -> T\n

Parse the owned content into structured output.

Returns:

Name Type Description T T

Parsed, structured representation.

Raises:

Type Description Exception

Parsing-specific errors as defined by the implementation.

Notes

Responsibilities:

- Implementations must fully consume the provided content and\n  return a deterministic, structured output.\n
"},{"location":"core/parser/#omniread.core.parser.BaseParser.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"core/scraper/","title":"Scraper","text":""},{"location":"core/scraper/#omniread.core.scraper","title":"omniread.core.scraper","text":""},{"location":"core/scraper/#omniread.core.scraper--summary","title":"Summary","text":"

Abstract scraping contracts for OmniRead.

This module defines the format-agnostic scraper interface responsible for acquiring raw content from external sources.

Scrapers are responsible for:

Scrapers are explicitly NOT responsible for:

All interpretation must be delegated to parsers.

"},{"location":"core/scraper/#omniread.core.scraper-classes","title":"Classes","text":""},{"location":"core/scraper/#omniread.core.scraper.BaseScraper","title":"BaseScraper","text":"

Bases: ABC

Base interface for all scrapers.

Notes

Responsibilities:

- A scraper is responsible ONLY for fetching raw content (bytes)\n  from a source. It must not interpret or parse it.\n- A scraper is a stateless acquisition component that retrieves raw\n  content from a source and returns it as a `Content` object.\n- Scrapers define how content is obtained, not what the content means.\n- Implementations may vary in transport mechanism, authentication\n  strategy, retry and backoff behavior.\n

Constraints:

- Implementations must not parse content, modify content semantics,\n  or couple scraping logic to a specific parser.\n
"},{"location":"core/scraper/#omniread.core.scraper.BaseScraper-functions","title":"Functions","text":""},{"location":"core/scraper/#omniread.core.scraper.BaseScraper.fetch","title":"fetch abstractmethod","text":"
fetch(\n    source: str,\n    *,\n    metadata: Mapping[str, Any] | None = None\n) -> Content\n

Fetch raw content from the given source.

Parameters:

Name Type Description Default source str

Location identifier (URL, file path, S3 URI, etc.).

required metadata Mapping[str, Any] | None

Optional hints for the scraper (headers, auth, etc.).

None

Returns:

Name Type Description Content Content

Content object containing raw bytes and metadata.

Raises:

Type Description Exception

Retrieval-specific errors as defined by the implementation.

Notes

Responsibilities:

- Implementations must retrieve the content referenced by `source`\n  and return it as raw bytes wrapped in a `Content` object.\n
"},{"location":"csv/","title":"Csv","text":""},{"location":"csv/#omniread.csv","title":"omniread.csv","text":""},{"location":"csv/#omniread.csv--summary","title":"Summary","text":"

CSV subpackage for OmniRead.

Provides acquisition and parsing of comma-separated-value content:

"},{"location":"csv/#omniread.csv-classes","title":"Classes","text":""},{"location":"csv/#omniread.csv.BaseCsvClient","title":"BaseCsvClient","text":"

Bases: ABC

Abstract client responsible for retrieving csv bytes.

Retrieves bytes from a specific backing store (filesystem, S3, FTP, etc.).

Notes

Responsibilities:

- Implementations must accept a source identifier appropriate to\n  the backing store.\n- Return the full csv binary payload.\n- Raise retrieval-specific errors on failure.\n
"},{"location":"csv/#omniread.csv.BaseCsvClient-functions","title":"Functions","text":""},{"location":"csv/#omniread.csv.BaseCsvClient.fetch","title":"fetch abstractmethod","text":"
fetch(source: Any) -> bytes\n

Fetch raw csv bytes from the given source.

Parameters:

Name Type Description Default source Any

Identifier of the csv location, such as a file path, object storage key, or remote reference.

required

Returns:

Name Type Description bytes bytes

Raw csv bytes.

Raises:

Type Description Exception

Retrieval-specific errors defined by the implementation.

"},{"location":"csv/#omniread.csv.CsvParser","title":"CsvParser","text":"
CsvParser(content: Content)\n

Bases: CsvParserBase[list[list[str]]]

Generic csv parser producing string rows from the document.

Notes

Responsibilities:

- Decode the payload (UTF-8 with BOM support, Latin-1 fallback).\n- Detect the delimiter from a leading sample (`,` `;` tab `|`),\n  defaulting to `,`.\n- Normalize cells into deterministic stripped string values.\n- Expose row extraction helpers mirroring `XlsxParser.rows`.\n

Constraints:

- All values are strings; consumers requiring typed values must\n  convert on their side.\n- Quoted fields containing delimiters/newlines are handled by\n  the standard ``csv`` module.\n

Initialize the parser.

Parameters:

Name Type Description Default content Content

CSV content to parse; its type must be supported.

required"},{"location":"csv/#omniread.csv.CsvParser-attributes","title":"Attributes","text":""},{"location":"csv/#omniread.csv.CsvParser.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = {CSV}\n

Set of content types supported by this parser (CSV only).

"},{"location":"csv/#omniread.csv.CsvParser-functions","title":"Functions","text":""},{"location":"csv/#omniread.csv.CsvParser.parse","title":"parse","text":"
parse() -> list[list[str]]\n

Parse the document into normalized string rows.

Returns:

Type Description list[list[str]]

list[list[str]]: Rows of the document.

"},{"location":"csv/#omniread.csv.CsvParser.rows","title":"rows","text":"
rows(*, skip_empty: bool = True) -> list[list[str]]\n

Extract normalized string rows from the document.

Parameters:

Name Type Description Default skip_empty bool

When True (default), rows whose cells are all blank are omitted.

True

Returns:

Type Description list[list[str]]

list[list[str]]: Normalized rows; trailing blank cells are trimmed per row.

"},{"location":"csv/#omniread.csv.CsvParser.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"csv/#omniread.csv.CsvParserBase","title":"CsvParserBase","text":"
CsvParserBase(content: Content)\n

Bases: BaseParser[T], Generic[T]

Base csv parser.

Notes

Responsibilities:

- This class enforces csv content-type compatibility and provides\n  the extension point for implementing concrete csv parsing\n  strategies.\n

Constraints:

- Concrete implementations must define the output type `T` and\n  implement the `parse()` method.\n

Initialize the parser with content to be parsed.

Parameters:

Name Type Description Default content Content

Content instance to be parsed.

required

Raises:

Type Description ValueError

If the content type is not supported by this parser.

"},{"location":"csv/#omniread.csv.CsvParserBase-attributes","title":"Attributes","text":""},{"location":"csv/#omniread.csv.CsvParserBase.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = {CSV}\n

Set of content types supported by this parser (CSV only).

"},{"location":"csv/#omniread.csv.CsvParserBase-functions","title":"Functions","text":""},{"location":"csv/#omniread.csv.CsvParserBase.parse","title":"parse abstractmethod","text":"
parse() -> T\n

Parse csv content into a structured output.

Returns:

Name Type Description T T

Parsed representation of type T.

Raises:

Type Description Exception

Parsing-specific errors as defined by the implementation.

"},{"location":"csv/#omniread.csv.CsvParserBase.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"csv/#omniread.csv.CsvScraper","title":"CsvScraper","text":"
CsvScraper(*, client: BaseCsvClient)\n

Scraper for csv documents.

Notes

Responsibilities:

- Fetch raw csv bytes via the configured client.\n- Wrap the payload in a canonical `Content` instance with the\n  CSV content type and source identifier.\n

Constraints:

- The scraper does not perform parsing or interpretation.\n- Does not assume a specific storage backend.\n

Initialize the CSV scraper.

Parameters:

Name Type Description Default client BaseCsvClient

Client responsible for retrieving raw csv bytes.

required"},{"location":"csv/#omniread.csv.CsvScraper-functions","title":"Functions","text":""},{"location":"csv/#omniread.csv.CsvScraper.fetch","title":"fetch","text":"
fetch(\n    source: Any,\n    *,\n    metadata: Mapping[str, Any] | None = None\n) -> Content\n

Fetch a csv document from the given source.

Parameters:

Name Type Description Default source Any

Identifier of the csv source as understood by the configured client.

required metadata Mapping[str, Any] | None

Optional metadata to attach to the returned content.

None

Returns:

Name Type Description Content Content

A Content instance containing raw csv bytes, source identifier, CSV content type, and optional metadata.

Raises:

Type Description Exception

Retrieval-specific errors raised by the client.

"},{"location":"csv/#omniread.csv.FileSystemCsvClient","title":"FileSystemCsvClient","text":"

Bases: BaseCsvClient

CSV client that reads from the local filesystem.

Notes

Guarantees:

- This client reads csv files directly from the disk and\n  returns their raw binary contents.\n
"},{"location":"csv/#omniread.csv.FileSystemCsvClient-functions","title":"Functions","text":""},{"location":"csv/#omniread.csv.FileSystemCsvClient.fetch","title":"fetch","text":"
fetch(path: Path) -> bytes\n

Read a csv file from the local filesystem.

Parameters:

Name Type Description Default path Path

Filesystem path to the csv file.

required

Returns:

Name Type Description bytes bytes

Raw csv bytes.

Raises:

Type Description FileNotFoundError

If the path does not exist.

ValueError

If the path exists but is not a file.

"},{"location":"csv/client/","title":"Client","text":""},{"location":"csv/client/#omniread.csv.client","title":"omniread.csv.client","text":""},{"location":"csv/client/#omniread.csv.client--summary","title":"Summary","text":"

CSV client abstractions for OmniRead.

This module defines the client layer responsible for retrieving raw comma-separated-value document bytes from a concrete backing store.

Clients provide low-level access to csv binaries and are intentionally decoupled from scraping and parsing logic. They do not perform validation, interpretation, or content extraction.

Typical backing stores include:

"},{"location":"csv/client/#omniread.csv.client-classes","title":"Classes","text":""},{"location":"csv/client/#omniread.csv.client.BaseCsvClient","title":"BaseCsvClient","text":"

Bases: ABC

Abstract client responsible for retrieving csv bytes.

Retrieves bytes from a specific backing store (filesystem, S3, FTP, etc.).

Notes

Responsibilities:

- Implementations must accept a source identifier appropriate to\n  the backing store.\n- Return the full csv binary payload.\n- Raise retrieval-specific errors on failure.\n
"},{"location":"csv/client/#omniread.csv.client.BaseCsvClient-functions","title":"Functions","text":""},{"location":"csv/client/#omniread.csv.client.BaseCsvClient.fetch","title":"fetch abstractmethod","text":"
fetch(source: Any) -> bytes\n

Fetch raw csv bytes from the given source.

Parameters:

Name Type Description Default source Any

Identifier of the csv location, such as a file path, object storage key, or remote reference.

required

Returns:

Name Type Description bytes bytes

Raw csv bytes.

Raises:

Type Description Exception

Retrieval-specific errors defined by the implementation.

"},{"location":"csv/client/#omniread.csv.client.FileSystemCsvClient","title":"FileSystemCsvClient","text":"

Bases: BaseCsvClient

CSV client that reads from the local filesystem.

Notes

Guarantees:

- This client reads csv files directly from the disk and\n  returns their raw binary contents.\n
"},{"location":"csv/client/#omniread.csv.client.FileSystemCsvClient-functions","title":"Functions","text":""},{"location":"csv/client/#omniread.csv.client.FileSystemCsvClient.fetch","title":"fetch","text":"
fetch(path: Path) -> bytes\n

Read a csv file from the local filesystem.

Parameters:

Name Type Description Default path Path

Filesystem path to the csv file.

required

Returns:

Name Type Description bytes bytes

Raw csv bytes.

Raises:

Type Description FileNotFoundError

If the path does not exist.

ValueError

If the path exists but is not a file.

"},{"location":"csv/parser/","title":"Parser","text":""},{"location":"csv/parser/#omniread.csv.parser","title":"omniread.csv.parser","text":""},{"location":"csv/parser/#omniread.csv.parser--summary","title":"Summary","text":"

CSV parser implementations for OmniRead.

This module provides a concrete, generic parser for comma-separated-value documents. It exposes records as lists of string cells so downstream consumers can interpret tabular content without depending on the csv module directly.

The parser is intentionally statement-agnostic: it performs no header detection or column interpretation beyond basic cell normalization and delimiter detection.

"},{"location":"csv/parser/#omniread.csv.parser-classes","title":"Classes","text":""},{"location":"csv/parser/#omniread.csv.parser.CsvParser","title":"CsvParser","text":"
CsvParser(content: Content)\n

Bases: CsvParserBase[list[list[str]]]

Generic csv parser producing string rows from the document.

Notes

Responsibilities:

- Decode the payload (UTF-8 with BOM support, Latin-1 fallback).\n- Detect the delimiter from a leading sample (`,` `;` tab `|`),\n  defaulting to `,`.\n- Normalize cells into deterministic stripped string values.\n- Expose row extraction helpers mirroring `XlsxParser.rows`.\n

Constraints:

- All values are strings; consumers requiring typed values must\n  convert on their side.\n- Quoted fields containing delimiters/newlines are handled by\n  the standard ``csv`` module.\n

Initialize the parser.

Parameters:

Name Type Description Default content Content

CSV content to parse; its type must be supported.

required"},{"location":"csv/parser/#omniread.csv.parser.CsvParser-attributes","title":"Attributes","text":""},{"location":"csv/parser/#omniread.csv.parser.CsvParser.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = {CSV}\n

Set of content types supported by this parser (CSV only).

"},{"location":"csv/parser/#omniread.csv.parser.CsvParser-functions","title":"Functions","text":""},{"location":"csv/parser/#omniread.csv.parser.CsvParser.parse","title":"parse","text":"
parse() -> list[list[str]]\n

Parse the document into normalized string rows.

Returns:

Type Description list[list[str]]

list[list[str]]: Rows of the document.

"},{"location":"csv/parser/#omniread.csv.parser.CsvParser.rows","title":"rows","text":"
rows(*, skip_empty: bool = True) -> list[list[str]]\n

Extract normalized string rows from the document.

Parameters:

Name Type Description Default skip_empty bool

When True (default), rows whose cells are all blank are omitted.

True

Returns:

Type Description list[list[str]]

list[list[str]]: Normalized rows; trailing blank cells are trimmed per row.

"},{"location":"csv/parser/#omniread.csv.parser.CsvParser.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"csv/parser_base/","title":"Parser Base","text":""},{"location":"csv/parser_base/#omniread.csv.parser_base","title":"omniread.csv.parser_base","text":""},{"location":"csv/parser_base/#omniread.csv.parser_base--summary","title":"Summary","text":"

CSV parser base implementation for OmniRead.

This module defines the CSV-specific parser contract, extending the format-agnostic BaseParser with constraints appropriate for comma-separated-value documents.

"},{"location":"csv/parser_base/#omniread.csv.parser_base-classes","title":"Classes","text":""},{"location":"csv/parser_base/#omniread.csv.parser_base.CsvParserBase","title":"CsvParserBase","text":"
CsvParserBase(content: Content)\n

Bases: BaseParser[T], Generic[T]

Base csv parser.

Notes

Responsibilities:

- This class enforces csv content-type compatibility and provides\n  the extension point for implementing concrete csv parsing\n  strategies.\n

Constraints:

- Concrete implementations must define the output type `T` and\n  implement the `parse()` method.\n

Initialize the parser with content to be parsed.

Parameters:

Name Type Description Default content Content

Content instance to be parsed.

required

Raises:

Type Description ValueError

If the content type is not supported by this parser.

"},{"location":"csv/parser_base/#omniread.csv.parser_base.CsvParserBase-attributes","title":"Attributes","text":""},{"location":"csv/parser_base/#omniread.csv.parser_base.CsvParserBase.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = {CSV}\n

Set of content types supported by this parser (CSV only).

"},{"location":"csv/parser_base/#omniread.csv.parser_base.CsvParserBase-functions","title":"Functions","text":""},{"location":"csv/parser_base/#omniread.csv.parser_base.CsvParserBase.parse","title":"parse abstractmethod","text":"
parse() -> T\n

Parse csv content into a structured output.

Returns:

Name Type Description T T

Parsed representation of type T.

Raises:

Type Description Exception

Parsing-specific errors as defined by the implementation.

"},{"location":"csv/parser_base/#omniread.csv.parser_base.CsvParserBase.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"csv/scraper/","title":"Scraper","text":""},{"location":"csv/scraper/#omniread.csv.scraper","title":"omniread.csv.scraper","text":""},{"location":"csv/scraper/#omniread.csv.scraper--summary","title":"Summary","text":"

CSV scraper for OmniRead.

This module defines the scraper responsible for acquiring raw comma-separated-value document content from a backing store via a configured client.

The scraper does not interpret or parse the acquired bytes; it wraps them in the canonical Content model.

"},{"location":"csv/scraper/#omniread.csv.scraper-classes","title":"Classes","text":""},{"location":"csv/scraper/#omniread.csv.scraper.CsvScraper","title":"CsvScraper","text":"
CsvScraper(*, client: BaseCsvClient)\n

Scraper for csv documents.

Notes

Responsibilities:

- Fetch raw csv bytes via the configured client.\n- Wrap the payload in a canonical `Content` instance with the\n  CSV content type and source identifier.\n

Constraints:

- The scraper does not perform parsing or interpretation.\n- Does not assume a specific storage backend.\n

Initialize the CSV scraper.

Parameters:

Name Type Description Default client BaseCsvClient

Client responsible for retrieving raw csv bytes.

required"},{"location":"csv/scraper/#omniread.csv.scraper.CsvScraper-functions","title":"Functions","text":""},{"location":"csv/scraper/#omniread.csv.scraper.CsvScraper.fetch","title":"fetch","text":"
fetch(\n    source: Any,\n    *,\n    metadata: Mapping[str, Any] | None = None\n) -> Content\n

Fetch a csv document from the given source.

Parameters:

Name Type Description Default source Any

Identifier of the csv source as understood by the configured client.

required metadata Mapping[str, Any] | None

Optional metadata to attach to the returned content.

None

Returns:

Name Type Description Content Content

A Content instance containing raw csv bytes, source identifier, CSV content type, and optional metadata.

Raises:

Type Description Exception

Retrieval-specific errors raised by the client.

"},{"location":"html/","title":"Html","text":""},{"location":"html/#omniread.html","title":"omniread.html","text":""},{"location":"html/#omniread.html--summary","title":"Summary","text":"

HTML format implementation for OmniRead.

This package provides HTML-specific implementations of the core OmniRead contracts defined in omniread.core.

It includes:

Key characteristics:

Consumers should depend on omniread.core interfaces wherever possible and use this package only when HTML-specific behavior is required.

"},{"location":"html/#omniread.html--public-api","title":"Public API","text":""},{"location":"html/#omniread.html-classes","title":"Classes","text":""},{"location":"html/#omniread.html.HTMLParser","title":"HTMLParser","text":"
HTMLParser(content: Content, features: str = 'html.parser')\n

Bases: BaseParser[T], Generic[T]

Base HTML parser.

Notes

Responsibilities:

- This class extends the core `BaseParser` with HTML-specific behavior,\n  including DOM parsing via BeautifulSoup and reusable extraction helpers.\n- Provides reusable helpers for HTML extraction. Concrete parsers must\n  explicitly define the return type.\n

Guarantees:

- Accepts only HTML content.\n- Owns a parsed BeautifulSoup DOM tree.\n- Provides pure helper utilities for common HTML structures.\n

Constraints:

- Concrete subclasses must define the output type `T` and implement\n  the `parse()` method.\n

Initialize the HTML parser.

Parameters:

Name Type Description Default content Content

HTML content to be parsed.

required features str

BeautifulSoup parser backend to use (e.g., 'html.parser', 'lxml').

'html.parser'

Raises:

Type Description ValueError

If the content is empty or not valid HTML.

"},{"location":"html/#omniread.html.HTMLParser-attributes","title":"Attributes","text":""},{"location":"html/#omniread.html.HTMLParser.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = {HTML}\n

Set of content types supported by this parser (HTML only).

"},{"location":"html/#omniread.html.HTMLParser-functions","title":"Functions","text":""},{"location":"html/#omniread.html.HTMLParser.parse","title":"parse abstractmethod","text":"
parse() -> T\n

Fully parse the HTML content into structured output.

Returns:

Name Type Description T T

Parsed representation of type T.

Notes

Responsibilities:

- Implementations must fully interpret the HTML DOM and return a\n  deterministic, structured output.\n
"},{"location":"html/#omniread.html.HTMLParser.parse_div","title":"parse_div staticmethod","text":"
parse_div(div: Tag, *, separator: str = ' ') -> str\n

Extract normalized text from a <div> element.

Parameters:

Name Type Description Default div Tag

BeautifulSoup tag representing a <div>.

required separator str

String used to separate text nodes.

' '

Returns:

Name Type Description str str

Flattened, whitespace-normalized text content.

"},{"location":"html/#omniread.html.HTMLParser.parse_link","title":"parse_link staticmethod","text":"
parse_link(a: Tag) -> str | None\n

Extract the hyperlink reference from an <a> element.

Parameters:

Name Type Description Default a Tag

BeautifulSoup tag representing an anchor.

required

Returns:

Type Description str | None

str | None: The value of the href attribute, or None if absent.

"},{"location":"html/#omniread.html.HTMLParser.parse_meta","title":"parse_meta","text":"
parse_meta() -> dict[str, Any]\n

Extract high-level metadata from the HTML document.

Returns:

Type Description dict[str, Any]

dict[str, Any]: Dictionary containing extracted metadata.

Notes

Responsibilities:

- Extract high-level metadata from the HTML document.\n- This includes: Document title, `<meta>` tag name/property to\n  content mappings.\n
"},{"location":"html/#omniread.html.HTMLParser.parse_table","title":"parse_table staticmethod","text":"
parse_table(table: Tag) -> list[list[str]]\n

Parse an HTML table into a 2D list of strings.

Parameters:

Name Type Description Default table Tag

BeautifulSoup tag representing a <table>.

required

Returns:

Type Description list[list[str]]

list[list[str]]: A list of rows, where each row is a list of cell text values.

"},{"location":"html/#omniread.html.HTMLParser.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"html/#omniread.html.HTMLScraper","title":"HTMLScraper","text":"
HTMLScraper(\n    *,\n    client: httpx.Client | None = None,\n    timeout: float = 15.0,\n    headers: Mapping[str, str] | None = None,\n    follow_redirects: bool = True\n)\n

Bases: BaseScraper

Base HTML scraper using httpx.

Notes

Responsibilities:

- This scraper retrieves HTML documents over HTTP(S) and returns\n  them as raw content wrapped in a `Content` object.\n- Fetches raw bytes and metadata only.\n- The scraper uses `httpx.Client` for HTTP requests, enforces an\n  HTML content type, and preserves HTTP response metadata.\n

Constraints:

- The scraper does not: Parse HTML, perform retries or backoff,\n  handle non-HTML responses.\n

Initialize the HTML scraper.

Parameters:

Name Type Description Default client Client | None

Optional pre-configured httpx.Client. If omitted, a client is created internally.

None timeout float

Request timeout in seconds.

15.0 headers Mapping[str, str] | None

Optional default HTTP headers.

None follow_redirects bool

Whether to follow HTTP redirects.

True"},{"location":"html/#omniread.html.HTMLScraper-functions","title":"Functions","text":""},{"location":"html/#omniread.html.HTMLScraper.fetch","title":"fetch","text":"
fetch(\n    source: str,\n    *,\n    metadata: Mapping[str, Any] | None = None\n) -> Content\n

Fetch an HTML document from the given source.

Parameters:

Name Type Description Default source str

URL of the HTML document.

required metadata Mapping[str, Any] | None

Optional metadata to be merged into the returned content.

None

Returns:

Name Type Description Content Content

A Content instance containing raw HTML bytes, source URL, HTML content type, and HTTP response metadata.

Raises:

Type Description HTTPError

If the HTTP request fails.

ValueError

If the response is not valid HTML.

"},{"location":"html/#omniread.html.HTMLScraper.validate_content_type","title":"validate_content_type","text":"
validate_content_type(response: httpx.Response) -> None\n

Validate that the HTTP response contains HTML content.

Parameters:

Name Type Description Default response Response

HTTP response returned by httpx.

required

Raises:

Type Description ValueError

If the Content-Type header is missing or does not indicate HTML content.

"},{"location":"html/parser/","title":"Parser","text":""},{"location":"html/parser/#omniread.html.parser","title":"omniread.html.parser","text":""},{"location":"html/parser/#omniread.html.parser--summary","title":"Summary","text":"

HTML parser base implementations for OmniRead.

This module provides reusable HTML parsing utilities built on top of the abstract parser contracts defined in omniread.core.parser.

It supplies:

Concrete parsers must subclass HTMLParser and implement the parse() method to return a structured representation appropriate for their use case.

"},{"location":"html/parser/#omniread.html.parser-classes","title":"Classes","text":""},{"location":"html/parser/#omniread.html.parser.HTMLParser","title":"HTMLParser","text":"
HTMLParser(content: Content, features: str = 'html.parser')\n

Bases: BaseParser[T], Generic[T]

Base HTML parser.

Notes

Responsibilities:

- This class extends the core `BaseParser` with HTML-specific behavior,\n  including DOM parsing via BeautifulSoup and reusable extraction helpers.\n- Provides reusable helpers for HTML extraction. Concrete parsers must\n  explicitly define the return type.\n

Guarantees:

- Accepts only HTML content.\n- Owns a parsed BeautifulSoup DOM tree.\n- Provides pure helper utilities for common HTML structures.\n

Constraints:

- Concrete subclasses must define the output type `T` and implement\n  the `parse()` method.\n

Initialize the HTML parser.

Parameters:

Name Type Description Default content Content

HTML content to be parsed.

required features str

BeautifulSoup parser backend to use (e.g., 'html.parser', 'lxml').

'html.parser'

Raises:

Type Description ValueError

If the content is empty or not valid HTML.

"},{"location":"html/parser/#omniread.html.parser.HTMLParser-attributes","title":"Attributes","text":""},{"location":"html/parser/#omniread.html.parser.HTMLParser.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = {HTML}\n

Set of content types supported by this parser (HTML only).

"},{"location":"html/parser/#omniread.html.parser.HTMLParser-functions","title":"Functions","text":""},{"location":"html/parser/#omniread.html.parser.HTMLParser.parse","title":"parse abstractmethod","text":"
parse() -> T\n

Fully parse the HTML content into structured output.

Returns:

Name Type Description T T

Parsed representation of type T.

Notes

Responsibilities:

- Implementations must fully interpret the HTML DOM and return a\n  deterministic, structured output.\n
"},{"location":"html/parser/#omniread.html.parser.HTMLParser.parse_div","title":"parse_div staticmethod","text":"
parse_div(div: Tag, *, separator: str = ' ') -> str\n

Extract normalized text from a <div> element.

Parameters:

Name Type Description Default div Tag

BeautifulSoup tag representing a <div>.

required separator str

String used to separate text nodes.

' '

Returns:

Name Type Description str str

Flattened, whitespace-normalized text content.

"},{"location":"html/parser/#omniread.html.parser.HTMLParser.parse_link","title":"parse_link staticmethod","text":"
parse_link(a: Tag) -> str | None\n

Extract the hyperlink reference from an <a> element.

Parameters:

Name Type Description Default a Tag

BeautifulSoup tag representing an anchor.

required

Returns:

Type Description str | None

str | None: The value of the href attribute, or None if absent.

"},{"location":"html/parser/#omniread.html.parser.HTMLParser.parse_meta","title":"parse_meta","text":"
parse_meta() -> dict[str, Any]\n

Extract high-level metadata from the HTML document.

Returns:

Type Description dict[str, Any]

dict[str, Any]: Dictionary containing extracted metadata.

Notes

Responsibilities:

- Extract high-level metadata from the HTML document.\n- This includes: Document title, `<meta>` tag name/property to\n  content mappings.\n
"},{"location":"html/parser/#omniread.html.parser.HTMLParser.parse_table","title":"parse_table staticmethod","text":"
parse_table(table: Tag) -> list[list[str]]\n

Parse an HTML table into a 2D list of strings.

Parameters:

Name Type Description Default table Tag

BeautifulSoup tag representing a <table>.

required

Returns:

Type Description list[list[str]]

list[list[str]]: A list of rows, where each row is a list of cell text values.

"},{"location":"html/parser/#omniread.html.parser.HTMLParser.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"html/scraper/","title":"Scraper","text":""},{"location":"html/scraper/#omniread.html.scraper","title":"omniread.html.scraper","text":""},{"location":"html/scraper/#omniread.html.scraper--summary","title":"Summary","text":"

HTML scraping implementation for OmniRead.

This module provides an HTTP-based scraper for retrieving HTML documents. It implements the core BaseScraper contract using httpx as the transport layer.

This scraper is responsible for:

This scraper is not responsible for:

"},{"location":"html/scraper/#omniread.html.scraper-classes","title":"Classes","text":""},{"location":"html/scraper/#omniread.html.scraper.HTMLScraper","title":"HTMLScraper","text":"
HTMLScraper(\n    *,\n    client: httpx.Client | None = None,\n    timeout: float = 15.0,\n    headers: Mapping[str, str] | None = None,\n    follow_redirects: bool = True\n)\n

Bases: BaseScraper

Base HTML scraper using httpx.

Notes

Responsibilities:

- This scraper retrieves HTML documents over HTTP(S) and returns\n  them as raw content wrapped in a `Content` object.\n- Fetches raw bytes and metadata only.\n- The scraper uses `httpx.Client` for HTTP requests, enforces an\n  HTML content type, and preserves HTTP response metadata.\n

Constraints:

- The scraper does not: Parse HTML, perform retries or backoff,\n  handle non-HTML responses.\n

Initialize the HTML scraper.

Parameters:

Name Type Description Default client Client | None

Optional pre-configured httpx.Client. If omitted, a client is created internally.

None timeout float

Request timeout in seconds.

15.0 headers Mapping[str, str] | None

Optional default HTTP headers.

None follow_redirects bool

Whether to follow HTTP redirects.

True"},{"location":"html/scraper/#omniread.html.scraper.HTMLScraper-functions","title":"Functions","text":""},{"location":"html/scraper/#omniread.html.scraper.HTMLScraper.fetch","title":"fetch","text":"
fetch(\n    source: str,\n    *,\n    metadata: Mapping[str, Any] | None = None\n) -> Content\n

Fetch an HTML document from the given source.

Parameters:

Name Type Description Default source str

URL of the HTML document.

required metadata Mapping[str, Any] | None

Optional metadata to be merged into the returned content.

None

Returns:

Name Type Description Content Content

A Content instance containing raw HTML bytes, source URL, HTML content type, and HTTP response metadata.

Raises:

Type Description HTTPError

If the HTTP request fails.

ValueError

If the response is not valid HTML.

"},{"location":"html/scraper/#omniread.html.scraper.HTMLScraper.validate_content_type","title":"validate_content_type","text":"
validate_content_type(response: httpx.Response) -> None\n

Validate that the HTTP response contains HTML content.

Parameters:

Name Type Description Default response Response

HTTP response returned by httpx.

required

Raises:

Type Description ValueError

If the Content-Type header is missing or does not indicate HTML content.

"},{"location":"pdf/","title":"Pdf","text":""},{"location":"pdf/#omniread.pdf","title":"omniread.pdf","text":""},{"location":"pdf/#omniread.pdf--summary","title":"Summary","text":"

PDF format implementation for OmniRead.

This package provides PDF-specific implementations of the core OmniRead contracts defined in omniread.core.

Unlike HTML, PDF handling requires an explicit client layer for document access. This package therefore includes:

Public exports from this package represent the supported PDF pipeline and are safe for consumers to import directly when working with PDFs.

"},{"location":"pdf/#omniread.pdf--public-api","title":"Public API","text":""},{"location":"pdf/#omniread.pdf-classes","title":"Classes","text":""},{"location":"pdf/#omniread.pdf.FileSystemPDFClient","title":"FileSystemPDFClient","text":"

Bases: BasePDFClient

PDF client that reads from the local filesystem.

Notes

Guarantees:

- This client reads PDF files directly from the disk and returns\n  their raw binary contents.\n
"},{"location":"pdf/#omniread.pdf.FileSystemPDFClient-functions","title":"Functions","text":""},{"location":"pdf/#omniread.pdf.FileSystemPDFClient.fetch","title":"fetch","text":"
fetch(path: Path) -> bytes\n

Read a PDF file from the local filesystem.

Parameters:

Name Type Description Default path Path

Filesystem path to the PDF file.

required

Returns:

Name Type Description bytes bytes

Raw PDF bytes.

Raises:

Type Description FileNotFoundError

If the path does not exist.

ValueError

If the path exists but is not a file.

"},{"location":"pdf/#omniread.pdf.PDFParser","title":"PDFParser","text":"
PDFParser(content: Content)\n

Bases: BaseParser[T], Generic[T]

Base PDF parser.

Notes

Responsibilities:

- This class enforces PDF content-type compatibility and provides\n  the extension point for implementing concrete PDF parsing strategies.\n

Constraints:

- Concrete implementations must define the output type `T` and\n  implement the `parse()` method.\n

Initialize the parser with content to be parsed.

Parameters:

Name Type Description Default content Content

Content instance to be parsed.

required

Raises:

Type Description ValueError

If the content type is not supported by this parser.

"},{"location":"pdf/#omniread.pdf.PDFParser-attributes","title":"Attributes","text":""},{"location":"pdf/#omniread.pdf.PDFParser.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = {PDF}\n

Set of content types supported by this parser (PDF only).

"},{"location":"pdf/#omniread.pdf.PDFParser-functions","title":"Functions","text":""},{"location":"pdf/#omniread.pdf.PDFParser.parse","title":"parse abstractmethod","text":"
parse() -> T\n

Parse PDF content into a structured output.

Returns:

Name Type Description T T

Parsed representation of type T.

Raises:

Type Description Exception

Parsing-specific errors as defined by the implementation.

Notes

Responsibilities:

- Implementations must fully interpret the PDF binary payload and\n  return a deterministic, structured output.\n
"},{"location":"pdf/#omniread.pdf.PDFParser.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"pdf/#omniread.pdf.PDFScraper","title":"PDFScraper","text":"
PDFScraper(*, client: BasePDFClient)\n

Bases: BaseScraper

Scraper for PDF sources.

Notes

Responsibilities:

- Delegates byte retrieval to a PDF client and normalizes output\n  into `Content`.\n- Preserves caller-provided metadata.\n

Constraints:

- The scraper does not perform parsing or interpretation.\n- Does not assume a specific storage backend.\n

Initialize the PDF scraper.

Parameters:

Name Type Description Default client BasePDFClient

PDF client responsible for retrieving raw PDF bytes.

required"},{"location":"pdf/#omniread.pdf.PDFScraper-functions","title":"Functions","text":""},{"location":"pdf/#omniread.pdf.PDFScraper.fetch","title":"fetch","text":"
fetch(\n    source: Any,\n    *,\n    metadata: Mapping[str, Any] | None = None\n) -> Content\n

Fetch a PDF document from the given source.

Parameters:

Name Type Description Default source Any

Identifier of the PDF source as understood by the configured PDF client.

required metadata Mapping[str, Any] | None

Optional metadata to attach to the returned content.

None

Returns:

Name Type Description Content Content

A Content instance containing raw PDF bytes, source identifier, PDF content type, and optional metadata.

Raises:

Type Description Exception

Retrieval-specific errors raised by the PDF client.

"},{"location":"pdf/client/","title":"Client","text":""},{"location":"pdf/client/#omniread.pdf.client","title":"omniread.pdf.client","text":""},{"location":"pdf/client/#omniread.pdf.client--summary","title":"Summary","text":"

PDF client abstractions for OmniRead.

This module defines the client layer responsible for retrieving raw PDF bytes from a concrete backing store.

Clients provide low-level access to PDF binaries and are intentionally decoupled from scraping and parsing logic. They do not perform validation, interpretation, or content extraction.

Typical backing stores include:

"},{"location":"pdf/client/#omniread.pdf.client-classes","title":"Classes","text":""},{"location":"pdf/client/#omniread.pdf.client.BasePDFClient","title":"BasePDFClient","text":"

Bases: ABC

Abstract client responsible for retrieving PDF bytes.

Retrieves bytes from a specific backing store (filesystem, S3, FTP, etc.).

Notes

Responsibilities:

- Implementations must accept a source identifier appropriate to\n  the backing store.\n- Return the full PDF binary payload.\n- Raise retrieval-specific errors on failure.\n
"},{"location":"pdf/client/#omniread.pdf.client.BasePDFClient-functions","title":"Functions","text":""},{"location":"pdf/client/#omniread.pdf.client.BasePDFClient.fetch","title":"fetch abstractmethod","text":"
fetch(source: Any) -> bytes\n

Fetch raw PDF bytes from the given source.

Parameters:

Name Type Description Default source Any

Identifier of the PDF location, such as a file path, object storage key, or remote reference.

required

Returns:

Name Type Description bytes bytes

Raw PDF bytes.

Raises:

Type Description Exception

Retrieval-specific errors defined by the implementation.

"},{"location":"pdf/client/#omniread.pdf.client.FileSystemPDFClient","title":"FileSystemPDFClient","text":"

Bases: BasePDFClient

PDF client that reads from the local filesystem.

Notes

Guarantees:

- This client reads PDF files directly from the disk and returns\n  their raw binary contents.\n
"},{"location":"pdf/client/#omniread.pdf.client.FileSystemPDFClient-functions","title":"Functions","text":""},{"location":"pdf/client/#omniread.pdf.client.FileSystemPDFClient.fetch","title":"fetch","text":"
fetch(path: Path) -> bytes\n

Read a PDF file from the local filesystem.

Parameters:

Name Type Description Default path Path

Filesystem path to the PDF file.

required

Returns:

Name Type Description bytes bytes

Raw PDF bytes.

Raises:

Type Description FileNotFoundError

If the path does not exist.

ValueError

If the path exists but is not a file.

"},{"location":"pdf/parser/","title":"Parser","text":""},{"location":"pdf/parser/#omniread.pdf.parser","title":"omniread.pdf.parser","text":""},{"location":"pdf/parser/#omniread.pdf.parser--summary","title":"Summary","text":"

PDF parser base implementations for OmniRead.

This module defines the PDF-specific parser contract, extending the format-agnostic BaseParser with constraints appropriate for PDF content.

PDF parsers are responsible for interpreting binary PDF data and producing structured representations suitable for downstream consumption.

"},{"location":"pdf/parser/#omniread.pdf.parser-classes","title":"Classes","text":""},{"location":"pdf/parser/#omniread.pdf.parser.PDFParser","title":"PDFParser","text":"
PDFParser(content: Content)\n

Bases: BaseParser[T], Generic[T]

Base PDF parser.

Notes

Responsibilities:

- This class enforces PDF content-type compatibility and provides\n  the extension point for implementing concrete PDF parsing strategies.\n

Constraints:

- Concrete implementations must define the output type `T` and\n  implement the `parse()` method.\n

Initialize the parser with content to be parsed.

Parameters:

Name Type Description Default content Content

Content instance to be parsed.

required

Raises:

Type Description ValueError

If the content type is not supported by this parser.

"},{"location":"pdf/parser/#omniread.pdf.parser.PDFParser-attributes","title":"Attributes","text":""},{"location":"pdf/parser/#omniread.pdf.parser.PDFParser.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = {PDF}\n

Set of content types supported by this parser (PDF only).

"},{"location":"pdf/parser/#omniread.pdf.parser.PDFParser-functions","title":"Functions","text":""},{"location":"pdf/parser/#omniread.pdf.parser.PDFParser.parse","title":"parse abstractmethod","text":"
parse() -> T\n

Parse PDF content into a structured output.

Returns:

Name Type Description T T

Parsed representation of type T.

Raises:

Type Description Exception

Parsing-specific errors as defined by the implementation.

Notes

Responsibilities:

- Implementations must fully interpret the PDF binary payload and\n  return a deterministic, structured output.\n
"},{"location":"pdf/parser/#omniread.pdf.parser.PDFParser.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"pdf/scraper/","title":"Scraper","text":""},{"location":"pdf/scraper/#omniread.pdf.scraper","title":"omniread.pdf.scraper","text":""},{"location":"pdf/scraper/#omniread.pdf.scraper--summary","title":"Summary","text":"

PDF scraping implementation for OmniRead.

This module provides a PDF-specific scraper that coordinates PDF byte retrieval via a client and normalizes the result into a Content object.

The scraper implements the core BaseScraper contract while delegating all storage and access concerns to a BasePDFClient implementation.

"},{"location":"pdf/scraper/#omniread.pdf.scraper-classes","title":"Classes","text":""},{"location":"pdf/scraper/#omniread.pdf.scraper.PDFScraper","title":"PDFScraper","text":"
PDFScraper(*, client: BasePDFClient)\n

Bases: BaseScraper

Scraper for PDF sources.

Notes

Responsibilities:

- Delegates byte retrieval to a PDF client and normalizes output\n  into `Content`.\n- Preserves caller-provided metadata.\n

Constraints:

- The scraper does not perform parsing or interpretation.\n- Does not assume a specific storage backend.\n

Initialize the PDF scraper.

Parameters:

Name Type Description Default client BasePDFClient

PDF client responsible for retrieving raw PDF bytes.

required"},{"location":"pdf/scraper/#omniread.pdf.scraper.PDFScraper-functions","title":"Functions","text":""},{"location":"pdf/scraper/#omniread.pdf.scraper.PDFScraper.fetch","title":"fetch","text":"
fetch(\n    source: Any,\n    *,\n    metadata: Mapping[str, Any] | None = None\n) -> Content\n

Fetch a PDF document from the given source.

Parameters:

Name Type Description Default source Any

Identifier of the PDF source as understood by the configured PDF client.

required metadata Mapping[str, Any] | None

Optional metadata to attach to the returned content.

None

Returns:

Name Type Description Content Content

A Content instance containing raw PDF bytes, source identifier, PDF content type, and optional metadata.

Raises:

Type Description Exception

Retrieval-specific errors raised by the PDF client.

"},{"location":"xlsx/","title":"Xlsx","text":""},{"location":"xlsx/#omniread.xlsx","title":"omniread.xlsx","text":""},{"location":"xlsx/#omniread.xlsx--summary","title":"Summary","text":"

XLSX subpackage for OmniRead.

Provides acquisition and parsing of Office Open XML spreadsheet (xlsx) content:

"},{"location":"xlsx/#omniread.xlsx-classes","title":"Classes","text":""},{"location":"xlsx/#omniread.xlsx.BaseXlsxClient","title":"BaseXlsxClient","text":"

Bases: ABC

Abstract client responsible for retrieving spreadsheet bytes.

Retrieves bytes from a specific backing store (filesystem, S3, FTP, etc.).

Notes

Responsibilities:

- 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.\n
"},{"location":"xlsx/#omniread.xlsx.BaseXlsxClient-functions","title":"Functions","text":""},{"location":"xlsx/#omniread.xlsx.BaseXlsxClient.fetch","title":"fetch abstractmethod","text":"
fetch(source: Any) -> bytes\n

Fetch raw xlsx bytes from the given source.

Parameters:

Name Type Description Default source Any

Identifier of the spreadsheet location, such as a file path, object storage key, or remote reference.

required

Returns:

Name Type Description bytes bytes

Raw xlsx bytes.

Raises:

Type Description Exception

Retrieval-specific errors defined by the implementation.

"},{"location":"xlsx/#omniread.xlsx.FileSystemXlsxClient","title":"FileSystemXlsxClient","text":"

Bases: BaseXlsxClient

XLSX client that reads from the local filesystem.

Notes

Guarantees:

- This client reads spreadsheet files directly from the disk and\n  returns their raw binary contents.\n
"},{"location":"xlsx/#omniread.xlsx.FileSystemXlsxClient-functions","title":"Functions","text":""},{"location":"xlsx/#omniread.xlsx.FileSystemXlsxClient.fetch","title":"fetch","text":"
fetch(path: Path) -> bytes\n

Read an xlsx file from the local filesystem.

Parameters:

Name Type Description Default path Path

Filesystem path to the spreadsheet file.

required

Returns:

Name Type Description bytes bytes

Raw xlsx bytes.

Raises:

Type Description FileNotFoundError

If the path does not exist.

ValueError

If the path exists but is not a file.

"},{"location":"xlsx/#omniread.xlsx.XlsxParser","title":"XlsxParser","text":"
XlsxParser(\n    content: Content,\n    *,\n    data_only: bool = True,\n    read_only: bool = True\n)\n

Bases: XlsxParserBase[list[list[str]]]

Generic xlsx parser producing string rows from a worksheet.

Notes

Responsibilities:

- 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

Constraints:

- 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.\n

Initialize the parser.

Parameters:

Name Type Description Default content Content

XLSX content to parse; its type must be supported.

required data_only bool

Passed to openpyxl: when True, formula cells yield their last computed value instead of the formula string.

True read_only bool

Passed to openpyxl: streaming mode for lower memory usage.

True"},{"location":"xlsx/#omniread.xlsx.XlsxParser-attributes","title":"Attributes","text":""},{"location":"xlsx/#omniread.xlsx.XlsxParser.sheet_names","title":"sheet_names property","text":"
sheet_names: list[str]\n

Names of all worksheets contained in the workbook.

"},{"location":"xlsx/#omniread.xlsx.XlsxParser.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = {XLSX}\n

Set of content types supported by this parser (XLSX only).

"},{"location":"xlsx/#omniread.xlsx.XlsxParser.workbook","title":"workbook property","text":"
workbook: Workbook\n

The lazily loaded workbook backing this parser's content.

"},{"location":"xlsx/#omniread.xlsx.XlsxParser-functions","title":"Functions","text":""},{"location":"xlsx/#omniread.xlsx.XlsxParser.parse","title":"parse","text":"
parse() -> list[list[str]]\n

Parse the first worksheet into normalized string rows.

Returns:

Type Description list[list[str]]

list[list[str]]: Rows of the default (first) worksheet.

"},{"location":"xlsx/#omniread.xlsx.XlsxParser.rows","title":"rows","text":"
rows(\n    sheet: int | str | None = None,\n    *,\n    skip_empty: bool = True\n) -> list[list[str]]\n

Extract normalized string rows from a worksheet.

Parameters:

Name Type Description Default sheet int | str | None

Worksheet index or title; defaults to the first worksheet.

None skip_empty bool

When True (default), rows whose cells are all blank are omitted.

True

Returns:

Type Description list[list[str]]

list[list[str]]: Normalized rows; trailing blank cells are trimmed per row.

Raises:

Type Description ValueError

If the requested sheet does not exist.

"},{"location":"xlsx/#omniread.xlsx.XlsxParser.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"xlsx/#omniread.xlsx.XlsxParserBase","title":"XlsxParserBase","text":"
XlsxParserBase(content: Content)\n

Bases: BaseParser[T], Generic[T]

Base xlsx parser.

Notes

Responsibilities:

- This class enforces xlsx content-type compatibility and provides\n  the extension point for implementing concrete xlsx parsing\n  strategies.\n

Constraints:

- Concrete implementations must define the output type `T` and\n  implement the `parse()` method.\n

Initialize the parser with content to be parsed.

Parameters:

Name Type Description Default content Content

Content instance to be parsed.

required

Raises:

Type Description ValueError

If the content type is not supported by this parser.

"},{"location":"xlsx/#omniread.xlsx.XlsxParserBase-attributes","title":"Attributes","text":""},{"location":"xlsx/#omniread.xlsx.XlsxParserBase.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = {XLSX}\n

Set of content types supported by this parser (XLSX only).

"},{"location":"xlsx/#omniread.xlsx.XlsxParserBase-functions","title":"Functions","text":""},{"location":"xlsx/#omniread.xlsx.XlsxParserBase.parse","title":"parse abstractmethod","text":"
parse() -> T\n

Parse xlsx content into a structured output.

Returns:

Name Type Description T T

Parsed representation of type T.

Raises:

Type Description Exception

Parsing-specific errors as defined by the implementation.

"},{"location":"xlsx/#omniread.xlsx.XlsxParserBase.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"xlsx/#omniread.xlsx.XlsxScraper","title":"XlsxScraper","text":"
XlsxScraper(*, client: BaseXlsxClient)\n

Scraper for xlsx spreadsheet documents.

Notes

Responsibilities:

- 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

Constraints:

- The scraper does not perform parsing or interpretation.\n- Does not assume a specific storage backend.\n

Initialize the XLSX scraper.

Parameters:

Name Type Description Default client BaseXlsxClient

Client responsible for retrieving raw spreadsheet bytes.

required"},{"location":"xlsx/#omniread.xlsx.XlsxScraper-functions","title":"Functions","text":""},{"location":"xlsx/#omniread.xlsx.XlsxScraper.fetch","title":"fetch","text":"
fetch(\n    source: Any,\n    *,\n    metadata: Mapping[str, Any] | None = None\n) -> Content\n

Fetch an xlsx document from the given source.

Parameters:

Name Type Description Default source Any

Identifier of the spreadsheet source as understood by the configured client.

required metadata Mapping[str, Any] | None

Optional metadata to attach to the returned content.

None

Returns:

Name Type Description Content Content

A Content instance containing raw xlsx bytes, source identifier, XLSX content type, and optional metadata.

Raises:

Type Description Exception

Retrieval-specific errors raised by the client.

"},{"location":"xlsx/client/","title":"Client","text":""},{"location":"xlsx/client/#omniread.xlsx.client","title":"omniread.xlsx.client","text":""},{"location":"xlsx/client/#omniread.xlsx.client--summary","title":"Summary","text":"

XLSX client abstractions for OmniRead.

This module defines the client layer responsible for retrieving raw Office Open XML spreadsheet bytes from a concrete backing store.

Clients provide low-level access to xlsx binaries and are intentionally decoupled from scraping and parsing logic. They do not perform validation, interpretation, or content extraction.

Typical backing stores include:

"},{"location":"xlsx/client/#omniread.xlsx.client-classes","title":"Classes","text":""},{"location":"xlsx/client/#omniread.xlsx.client.BaseXlsxClient","title":"BaseXlsxClient","text":"

Bases: ABC

Abstract client responsible for retrieving spreadsheet bytes.

Retrieves bytes from a specific backing store (filesystem, S3, FTP, etc.).

Notes

Responsibilities:

- 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.\n
"},{"location":"xlsx/client/#omniread.xlsx.client.BaseXlsxClient-functions","title":"Functions","text":""},{"location":"xlsx/client/#omniread.xlsx.client.BaseXlsxClient.fetch","title":"fetch abstractmethod","text":"
fetch(source: Any) -> bytes\n

Fetch raw xlsx bytes from the given source.

Parameters:

Name Type Description Default source Any

Identifier of the spreadsheet location, such as a file path, object storage key, or remote reference.

required

Returns:

Name Type Description bytes bytes

Raw xlsx bytes.

Raises:

Type Description Exception

Retrieval-specific errors defined by the implementation.

"},{"location":"xlsx/client/#omniread.xlsx.client.FileSystemXlsxClient","title":"FileSystemXlsxClient","text":"

Bases: BaseXlsxClient

XLSX client that reads from the local filesystem.

Notes

Guarantees:

- This client reads spreadsheet files directly from the disk and\n  returns their raw binary contents.\n
"},{"location":"xlsx/client/#omniread.xlsx.client.FileSystemXlsxClient-functions","title":"Functions","text":""},{"location":"xlsx/client/#omniread.xlsx.client.FileSystemXlsxClient.fetch","title":"fetch","text":"
fetch(path: Path) -> bytes\n

Read an xlsx file from the local filesystem.

Parameters:

Name Type Description Default path Path

Filesystem path to the spreadsheet file.

required

Returns:

Name Type Description bytes bytes

Raw xlsx bytes.

Raises:

Type Description FileNotFoundError

If the path does not exist.

ValueError

If the path exists but is not a file.

"},{"location":"xlsx/parser/","title":"Parser","text":""},{"location":"xlsx/parser/#omniread.xlsx.parser","title":"omniread.xlsx.parser","text":""},{"location":"xlsx/parser/#omniread.xlsx.parser--summary","title":"Summary","text":"

XLSX parser implementations for OmniRead.

This module provides a concrete, generic parser for Office Open XML spreadsheets. It exposes workbook sheets as lists of string rows so downstream consumers can interpret tabular content without depending on openpyxl directly.

The parser is intentionally statement-agnostic: it performs no header detection or column interpretation beyond basic cell normalization.

"},{"location":"xlsx/parser/#omniread.xlsx.parser-classes","title":"Classes","text":""},{"location":"xlsx/parser/#omniread.xlsx.parser.XlsxParser","title":"XlsxParser","text":"
XlsxParser(\n    content: Content,\n    *,\n    data_only: bool = True,\n    read_only: bool = True\n)\n

Bases: XlsxParserBase[list[list[str]]]

Generic xlsx parser producing string rows from a worksheet.

Notes

Responsibilities:

- 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

Constraints:

- 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.\n

Initialize the parser.

Parameters:

Name Type Description Default content Content

XLSX content to parse; its type must be supported.

required data_only bool

Passed to openpyxl: when True, formula cells yield their last computed value instead of the formula string.

True read_only bool

Passed to openpyxl: streaming mode for lower memory usage.

True"},{"location":"xlsx/parser/#omniread.xlsx.parser.XlsxParser-attributes","title":"Attributes","text":""},{"location":"xlsx/parser/#omniread.xlsx.parser.XlsxParser.sheet_names","title":"sheet_names property","text":"
sheet_names: list[str]\n

Names of all worksheets contained in the workbook.

"},{"location":"xlsx/parser/#omniread.xlsx.parser.XlsxParser.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = {XLSX}\n

Set of content types supported by this parser (XLSX only).

"},{"location":"xlsx/parser/#omniread.xlsx.parser.XlsxParser.workbook","title":"workbook property","text":"
workbook: Workbook\n

The lazily loaded workbook backing this parser's content.

"},{"location":"xlsx/parser/#omniread.xlsx.parser.XlsxParser-functions","title":"Functions","text":""},{"location":"xlsx/parser/#omniread.xlsx.parser.XlsxParser.parse","title":"parse","text":"
parse() -> list[list[str]]\n

Parse the first worksheet into normalized string rows.

Returns:

Type Description list[list[str]]

list[list[str]]: Rows of the default (first) worksheet.

"},{"location":"xlsx/parser/#omniread.xlsx.parser.XlsxParser.rows","title":"rows","text":"
rows(\n    sheet: int | str | None = None,\n    *,\n    skip_empty: bool = True\n) -> list[list[str]]\n

Extract normalized string rows from a worksheet.

Parameters:

Name Type Description Default sheet int | str | None

Worksheet index or title; defaults to the first worksheet.

None skip_empty bool

When True (default), rows whose cells are all blank are omitted.

True

Returns:

Type Description list[list[str]]

list[list[str]]: Normalized rows; trailing blank cells are trimmed per row.

Raises:

Type Description ValueError

If the requested sheet does not exist.

"},{"location":"xlsx/parser/#omniread.xlsx.parser.XlsxParser.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"xlsx/parser_base/","title":"Parser Base","text":""},{"location":"xlsx/parser_base/#omniread.xlsx.parser_base","title":"omniread.xlsx.parser_base","text":""},{"location":"xlsx/parser_base/#omniread.xlsx.parser_base--summary","title":"Summary","text":"

XLSX parser base implementation for OmniRead.

This module defines the XLSX-specific parser contract, extending the format-agnostic BaseParser with constraints appropriate for Office Open XML spreadsheet content.

"},{"location":"xlsx/parser_base/#omniread.xlsx.parser_base-classes","title":"Classes","text":""},{"location":"xlsx/parser_base/#omniread.xlsx.parser_base.XlsxParserBase","title":"XlsxParserBase","text":"
XlsxParserBase(content: Content)\n

Bases: BaseParser[T], Generic[T]

Base xlsx parser.

Notes

Responsibilities:

- This class enforces xlsx content-type compatibility and provides\n  the extension point for implementing concrete xlsx parsing\n  strategies.\n

Constraints:

- Concrete implementations must define the output type `T` and\n  implement the `parse()` method.\n

Initialize the parser with content to be parsed.

Parameters:

Name Type Description Default content Content

Content instance to be parsed.

required

Raises:

Type Description ValueError

If the content type is not supported by this parser.

"},{"location":"xlsx/parser_base/#omniread.xlsx.parser_base.XlsxParserBase-attributes","title":"Attributes","text":""},{"location":"xlsx/parser_base/#omniread.xlsx.parser_base.XlsxParserBase.supported_types","title":"supported_types class-attribute instance-attribute","text":"
supported_types: set[ContentType] = {XLSX}\n

Set of content types supported by this parser (XLSX only).

"},{"location":"xlsx/parser_base/#omniread.xlsx.parser_base.XlsxParserBase-functions","title":"Functions","text":""},{"location":"xlsx/parser_base/#omniread.xlsx.parser_base.XlsxParserBase.parse","title":"parse abstractmethod","text":"
parse() -> T\n

Parse xlsx content into a structured output.

Returns:

Name Type Description T T

Parsed representation of type T.

Raises:

Type Description Exception

Parsing-specific errors as defined by the implementation.

"},{"location":"xlsx/parser_base/#omniread.xlsx.parser_base.XlsxParserBase.supports","title":"supports","text":"
supports() -> bool\n

Check whether this parser supports the content's type.

Returns:

Name Type Description bool bool

True if the content type is supported; False otherwise.

"},{"location":"xlsx/scraper/","title":"Scraper","text":""},{"location":"xlsx/scraper/#omniread.xlsx.scraper","title":"omniread.xlsx.scraper","text":""},{"location":"xlsx/scraper/#omniread.xlsx.scraper--summary","title":"Summary","text":"

XLSX scraper for OmniRead.

This module defines the scraper responsible for acquiring raw Office Open XML spreadsheet content from a backing store via a configured client.

The scraper does not interpret or parse the acquired bytes; it wraps them in the canonical Content model.

"},{"location":"xlsx/scraper/#omniread.xlsx.scraper-classes","title":"Classes","text":""},{"location":"xlsx/scraper/#omniread.xlsx.scraper.XlsxScraper","title":"XlsxScraper","text":"
XlsxScraper(*, client: BaseXlsxClient)\n

Scraper for xlsx spreadsheet documents.

Notes

Responsibilities:

- 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

Constraints:

- The scraper does not perform parsing or interpretation.\n- Does not assume a specific storage backend.\n

Initialize the XLSX scraper.

Parameters:

Name Type Description Default client BaseXlsxClient

Client responsible for retrieving raw spreadsheet bytes.

required"},{"location":"xlsx/scraper/#omniread.xlsx.scraper.XlsxScraper-functions","title":"Functions","text":""},{"location":"xlsx/scraper/#omniread.xlsx.scraper.XlsxScraper.fetch","title":"fetch","text":"
fetch(\n    source: Any,\n    *,\n    metadata: Mapping[str, Any] | None = None\n) -> Content\n

Fetch an xlsx document from the given source.

Parameters:

Name Type Description Default source Any

Identifier of the spreadsheet source as understood by the configured client.

required metadata Mapping[str, Any] | None

Optional metadata to attach to the returned content.

None

Returns:

Name Type Description Content Content

A Content instance containing raw xlsx bytes, source identifier, XLSX content type, and optional metadata.

Raises:

Type Description Exception

Retrieval-specific errors raised by the client.

"}]}