Coverage for src / quber / core / parsers / base.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.14.0, created at 2026-09-23 22:14 -0400

1from abc import ABC, abstractmethod 

2from pathlib import Path 

3 

4from quber.core.parsers.result import ParseResult 

5 

6 

7class Parser(ABC): 

8 """Engine-agnostic seam: a source file becomes a `ParseResult`. 

9 

10 The `ParseResult` carries the canonical `DoclingDocument` (Quber's in-memory 

11 IR) on `.document`, plus the per-page confidence, parsed-page cells, and 

12 per-table OCR/native provenance docling produces alongside it. Concrete 

13 parsers (`DoclingParser` subclasses, `MockParser`) inherit this and implement 

14 `parse`. 

15 """ 

16 

17 @abstractmethod 

18 def parse(self, source: Path) -> ParseResult: ...