mmar-mapi 1.0.20__tar.gz → 1.0.22__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mmar-mapi might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mmar-mapi
3
- Version: 1.0.20
3
+ Version: 1.0.22
4
4
  Summary: Common pure/IO utilities for multi-modal architectures team
5
5
  Keywords:
6
6
  Author: Eugene Tagin
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "mmar-mapi"
3
3
  # dynamic version is not supported yet on uv_build
4
- version = "1.0.20"
4
+ version = "1.0.22"
5
5
  description = "Common pure/IO utilities for multi-modal architectures team"
6
6
  authors = [{name = "Eugene Tagin", email = "tagin@airi.net"}]
7
7
  license = "MIT"
@@ -71,12 +71,18 @@ class TextExtractorAPI:
71
71
  raise NotImplementedError
72
72
 
73
73
 
74
- PageRange = Annotated[tuple[int, int], AfterValidator(lambda rng: rng[0] <= rng[1])]
74
+ def _validate_page_range(v: tuple[int, int]) -> tuple[int, int]:
75
+ if v[0] < 1 or v[1] < v[0]:
76
+ raise ValueError("Invalid page range: start must be ≥ 1 and end must be ≥ start.")
77
+ return v
78
+
79
+
80
+ PageRange = Annotated[tuple[int, int], AfterValidator(_validate_page_range)]
75
81
  ForceOCR = StrEnum("ForceOCR", ["ENABLED", "DISABLED", "AUTO"])
76
82
  OutputType = StrEnum("OutputType", ["RAW", "PLAIN", "MARKDOWN"])
77
83
 
78
84
 
79
- class ExtractionEngineSpec(BaseModel):
85
+ class ExtractionEngineSpec(BaseModel, frozen=True):
80
86
  output_type: OutputType = OutputType.MARKDOWN
81
87
  force_ocr: ForceOCR = ForceOCR.AUTO
82
88
  do_ocr: bool = False
@@ -88,7 +94,7 @@ class ExtractionEngineSpec(BaseModel):
88
94
  images_scale: float = 2.0
89
95
 
90
96
 
91
- class DocExtractionSpec(BaseModel):
97
+ class DocExtractionSpec(BaseModel, frozen=True):
92
98
  page_range: PageRange | None = None
93
99
  engine: ExtractionEngineSpec = ExtractionEngineSpec()
94
100
 
File without changes
File without changes