Files
omniread/docs/wiki/01_overview.md
Vishesh 'ironeagle' Bangotra 650d3a19e8 chore(release): 0.0.3
Squash-merge lib-standardisation: adopt repo standards across packaging,
tooling, docs, and CI.

- standardize pyproject.toml (canonical packaging, lint config, extras, GSDFC pydoclint)
- add py.typed marker, modernize type hints and Google-style docstrings
- nest generated docs under docs/lib and docs/mcp; add hand-written wiki
- adopt standard Type A PyPI CI pipeline (tag==version guard + quality gate)
- promote generated CHANGELOG.md; bump version to 0.0.3
2026-10-17 02:16:48 +05:30

3.1 KiB

🧱 Overview

OmniRead is designed as a decoupled content engine with three distinct layers. Understanding them is the key to using and extending the library.


🏗️ Architecture

                 ┌─────────────────────────────┐
                 │  Source (URL, file, storage) │
                 └────────────┬────────────────┘
                              │
                    ┌─────────▼──────────┐
                    │   Scraper / Client  │  fetches raw bytes
                    └─────────┬──────────┘
                              │  returns
                    ┌─────────▼──────────┐
                    │     Content         │  raw + source + type
                    └─────────┬──────────┘
                              │
                    ┌─────────▼──────────┐
                    │      Parser         │  parse() → structured T
                    └────────────────────┘
  1. Scraper (BaseScraper) — fetches raw bytes from a source (HTTP URL, filesystem path, object storage). Returns a Content instance. Scrapers never interpret content.
  2. Content (Content) — the canonical exchange model: raw bytes, source identifier, and optional ContentType enum.
  3. Parser (BaseParser[T]) — receives a Content and returns a structured result of type T via parse().

📦 The Content model

Defined in omniread.core.content:

from dataclasses import dataclass
from omniread import Content, ContentType

@dataclass(slots=True)
class Content:
    raw: bytes
    source: str
    content_type: ContentType | None = None
  • raw — the raw bytes exactly as retrieved.
  • source — URL, file path, or logical name identifying the origin.
  • content_type — optional ContentType enum value.

🎭 The ContentType enum

Value MIME Used by
HTML text/html HTMLScraper
PDF application/pdf PDFScraper
XLSX application/vnd.openxmlformats-... XlsxScraper
CSV text/csv CsvScraper
JSON application/json —
XML application/xml —

🧩 Format modules at a glance

Module Scraper Parser Client Notes
omniread.html HTMLScraper HTMLParser — httpx + BeautifulSoup
omniread.pdf PDFScraper PDFParser FileSystemPDFClient explicit client layer
omniread.csv CsvScraper CsvParser FileSystemCsvClient stdlib csv module
omniread.xlsx XlsxScraper XlsxParser FileSystemXlsxClient openpyxl-backed