Metadata-Version: 2.5
Name: khmer-id-reader
Version: 0.1.0
Summary: Free Cambodian national ID card OCR — reads all fields, verifies MRZ.
Project-URL: Homepage, https://github.com/vattanac/khmer-id-reader
Project-URL: Documentation, https://github.com/vattanac/khmer-id-reader#readme
Project-URL: Issues, https://github.com/vattanac/khmer-id-reader/issues
Author-email: Sim Vattanac <vattanacsim99@gmail.com>
License-Expression: Apache-2.0
Keywords: cambodia,crnn,id-card,khmer,mrz,ocr
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Requires-Python: >=3.9
Requires-Dist: huggingface-hub>=0.20
Requires-Dist: numpy>=1.20
Requires-Dist: opencv-python-headless>=4.5
Requires-Dist: pillow>=9.0
Requires-Dist: torch>=2.0
Requires-Dist: torchvision>=0.15
Provides-Extra: server
Requires-Dist: flask>=3.0; extra == 'server'
Provides-Extra: tesseract
Requires-Dist: pytesseract>=0.3; extra == 'tesseract'
Description-Content-Type: text/markdown

# khmer-id-reader

Free, open-source Cambodian national ID card OCR library.

Reads all printed fields, verifies MRZ check digits, and cross-checks the Khmer name against the Latin printing.

## Install

```bash
pip install khmer-id-reader
```

## Usage

### Python

```python
from khmer_id_reader import read_card

result = read_card("my_id_photo.jpg")
print(result.name_latin)   # SIM VATTANAC
print(result.id_number)    # 101080854 (01)
print(result.mrz_verified) # True
print(result.to_json())    # full JSON output
```

### Command line

```bash
khmer-id-reader my_id_photo.jpg
```

## What it reads

- Name (Khmer + Latin, cross-verified)
- Date of birth, sex, height
- Place of birth
- Address (verified against national gazetteer)
- ID number
- Validity period
- Nationality
- Full MRZ (3 lines, check-digit verified)

## Models

Models are auto-downloaded from [HuggingFace](https://huggingface.co/vattanac/khmer-ocr-crnn-ctc) on first use (~50 MB).

## License

Apache 2.0

## Author

Sim Vattanac
