Metadata-Version: 2.4
Name: ocrval
Version: 0.1.0
Summary: OCR output quality validation — heuristic scoring pipeline for any OCR engine
Project-URL: Repository, https://github.com/pjmalandrino/ocrval
Author: PJ Malandrino
License-Expression: MIT
License-File: LICENSE
Keywords: docling,nlp,ocr,quality,validation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Text Processing
Requires-Python: >=3.12
Requires-Dist: pydantic>=2.0
Provides-Extra: api
Requires-Dist: fastapi>=0.115; extra == 'api'
Requires-Dist: pydantic-settings>=2.0; extra == 'api'
Requires-Dist: uvicorn[standard]>=0.30; extra == 'api'
Provides-Extra: dev
Requires-Dist: httpx>=0.27; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Description-Content-Type: text/markdown

# ocrval

OCR output quality validation — heuristic scoring pipeline for any OCR engine.

## Install

```bash
pip install ocrval
```

## Quick start

```python
from ocrval import validate_document, validate_text

# From Docling JSON — dictionary auto-downloaded and cached
result = validate_document(docling_json, lang="fr")

# With domain-specific words
result = validate_document(
    docling_json,
    lang="fr",
    custom_words=["bornier", "domotique"],
)

# From plain text chunks
result = validate_text(["Chunk 1 text", "Chunk 2 text"], lang="fr")

print(result.overall_score)  # 0.82
print(result.bucket)         # "good"
```

## API demo server

```bash
pip install ocrval[api]
uvicorn ocrval.adapters.inbound.api.app:app --port 8000
```

## License

MIT
