James R. Barlow and aider
01ea6c2b8b
feat: add ValidationCoordinator for cross-cutting validation
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:48 -08:00
James R. Barlow and aider
f02d733d31
feat: add legacy field mapping to plugin registry
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:48 -08:00
James R. Barlow and aider
28d6ea0f10
feat: Add CLI generation methods to plugin option models
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:48 -08:00
James R. Barlow and aider
6913ec7cb8
feat: add PluginOptionRegistry for dynamic option models
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:48 -08:00
James R. Barlow and aider
40f01d85ae
refactor: convert jbig2 properties to direct fields in OCROptions
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:48 -08:00
James R. Barlow and aider
b7640bdb9c
feat: implement plugin option models with backward compatibility
...
This commit introduces Pydantic models for plugin-specific options in OCRmyPDF, focusing on:
- Creating TesseractOptions, OptimizeOptions, and GhostscriptOptions
- Adding backward compatibility properties
- Maintaining existing CLI and API functionality
- Preparing for future plugin option registration system
The changes include:
- Added type-annotated option models with validation
- Updated OCROptions to include legacy fields
- Added backward compatibility properties for jbig2 options
- Prepared groundwork for dynamic plugin option handling
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:48 -08:00
James R. Barlow and aider
62ad37b276
refactor: centralize plugin manager setup
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:48 -08:00
James R. Barlow
b1de6a6ad4
Add more cached tests
2025-12-21 12:21:48 -08:00
James R. Barlow
e4fa9dbc8f
Drop obsolete subclass of ArgumentParser
2025-12-21 12:21:48 -08:00
James R. Barlow
b7737446e4
cli: push up imports
2025-12-21 12:21:48 -08:00
James R. Barlow and aider
42891346d1
fix: update test files to use new get_options_and_plugins function
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:48 -08:00
James R. Barlow and aider
4ed0e4510c
fix: add type checking imports for OCROptions and pluggy
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:48 -08:00
James R. Barlow and aider
4f9c4c3e52
refactor: reorganize CLI and options initialization
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:48 -08:00
James R. Barlow
08ee5690bc
Remove to_namespace and its user, since nothing triggers it
2025-12-21 12:21:48 -08:00
James R. Barlow
3f38ea4d80
Remove OCROptions getattr interface
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
f04b5504e8
test: fix hOCR pipeline output folder handling
...
The commit message captures the essence of the changes: we fixed how the output folder is handled in the hOCR pipeline by making it a proper field in OCROptions and updating the API functions accordingly.
Would you like me to generate a full commit message or is this sufficient?
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow
69185e5819
refactor: remove custom attribute handling methods and add output_folder option
2025-12-21 12:21:47 -08:00
James R. Barlow
ade3ecd5a1
fix: add error handling in hOCR pipeline
2025-12-21 12:21:47 -08:00
James R. Barlow
e4f8ba8edc
Fix computing of lossless_reconstruction and checking of redo_ocr conflicts
2025-12-21 12:21:47 -08:00
James R. Barlow
1225c0a45e
fix: correct typing issues in concurrent and optimize modules
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
f0c292f4e1
refactor: Remove CLI-parser dependencies in experimental API functions
...
This commit updates `_pdf_to_hocr` and `_hocr_to_ocr_pdf` to use direct OCROptions construction, eliminating the last vestiges of CLI-parser dependency in the experimental APIs.
Key changes:
- Removed `parser = get_parser()` calls
- Added plugin validation similar to main `ocr()` function
- Simplified plugin manager hook calls
- Added None value filtering to use OCROptions defaults
- Maintained error handling and extra_attrs logic
The refactoring makes these experimental APIs truly API-first and simplifies the code by removing unnecessary CLI-related complexity.
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow
1f493ba789
refactor: post-AI code cleanup
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
e1d976168c
feat: handle Pydantic serialization iterators in JSON serialization
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
60182ac8a8
fix: update JSON serialization tests to match default values
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow
53db7b384b
refactor: set default values for optional OCR configuration parameters
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
d77d63f1dc
feat: add JSON serialization tests for OCROptions in multiprocessing
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
ff250afa51
fix: add helper function to calculate effective JBIG2 page group size
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
cdb976db41
fix: handle None or zero jbig2_page_group_size in extract_images_jbig2
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
9535b52d06
fix: revert default option values to preserve original behavior
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
fix: set default optimize value to 1 to prevent NoneType comparison
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
e1216eddb0
test: modify test_two_languages to use list of languages
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
21d69ffe87
fix: set default value for fast_web_view to prevent NoneType errors
...
This change ensures that `fast_web_view` always has a default value of 1.0, preventing the TypeError that was occurring in multiple test cases when trying to multiply `None` with an integer.
The modifications include:
1. Changing the type hint for `fast_web_view` from `float | None` to `float`
2. Setting a default value of 1.0
3. Adding a validation step in the `model_validator` to set the default value if not provided
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
3baeb83533
fix: Add compatibility for jpeg_quality and resolve strategy validation
...
This commit addresses several test failures by:
- Adding a compatibility property for `jpeg_quality`
- Changing default color conversion strategy from 'auto' to 'RGB'
- Ensuring `tesseract_config` is always a list
- Improving validation for color conversion and image compression strategies
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
134f4fcc28
fix: remove Union type hints and add default values in OCROptions
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
a869a4ac42
fix: filter out None values from OCROptions kwargs
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
48a2fdb0f2
refactor: replace _kwargs_to_cmdline with direct OCROptions construction in experimental API functions
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
91a2d39845
refactor: replace command line synthesis with direct OCROptions construction
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
3a0a7c546b
feat: Implement JSON serialization for OCROptions with safe handling of Path and stream objects
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
d0a46a0359
feat: convert CLI Namespace to OCROptions in main entry point
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
cb22a35834
refactor: convert hOCR API entry points to use OCROptions
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
9ff7ab491c
fix: handle None jobs in hOCR pipeline concurrency
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
refactor: remove unused argparse import from pdf_to_hocr.py
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
fix: import OCROptions in pdf_to_hocr pipeline
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
fix: handle None jobs in hocr_to_ocr_pdf pipeline
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
0c3110857e
fix: add lossless_reconstruction to namespace options in PdfContext
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
aad90bcb54
fix: compute lossless_reconstruction when not present in options
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
5f685aef6e
fix: handle None jobs in concurrent processing
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
65b89cafde
fix: use available_cpu_count fallback for jobs in hOCR
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
eeda99636a
fix: handle Namespace conversion in PdfContext initialization
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
afc85333ac
feat: add OCROptions import and type hints to pipeline functions
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
3987a610e1
fix: update pipeline setup to handle immutable OCROptions correctly
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
dab969f97d
refactor: update context management with OCROptions type hints
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00
James R. Barlow
480a8253eb
refactor: propagate lossless_reconstruction option to clean_options in PageContext
2025-12-21 12:21:47 -08:00
James R. Barlow and aider
8a06dd478a
refactor: update pipeline functions to use OCROptions instead of argparse.Namespace
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:47 -08:00