Metadata-Version: 2.4
Name: dengjen-tashkeel-py
Version: 3.0.1
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Dist: onnxruntime>=1.28,<2
Summary: Python bindings for dengjen-tashkeel: Arabic diacritic restoration with a neural model
Keywords: arabic,tashkeel,diacritics,harakat,nlp,onnx
License-Expression: MIT OR Apache-2.0
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Issues, https://github.com/ZirekHQ/dengjen-tashkeel/issues
Project-URL: Repository, https://github.com/ZirekHQ/dengjen-tashkeel

# dengjen-tashkeel Python bindings

PyO3-based Python bindings over `dengjen-tashkeel` (crates/core), exposing `tashkeel(text, taskeen_threshold=None, preprocessed=None)`, which diacritizes Arabic text using a module-level inference engine, and `init(model_path=None)`, which loads that engine up front or from a custom ONNX file.

Importing the module locates the shared library of the pip-installed `onnxruntime` package
(`onnxruntime>=1.28,<2`, declared as a dependency); a missing or broken `onnxruntime` raises
`RuntimeError` at import. The engine loads on the first `tashkeel` call with the bundled model, or
earlier through `init`, which raises `RuntimeError` if it is already loaded. `tashkeel` raises
`ValueError` when a sentence exceeds `CHAR_LIMIT` (12,000 characters) and `RuntimeError` for any
other failure, including a model that cannot be loaded.
Don't install `onnxruntime-gpu` alongside `onnxruntime`; they share one import name.

```python
from dengjen_tashkeel_py import tashkeel

tashkeel("بسم الله الرحمن الرحيم")
```

Builds as the `dengjen_tashkeel_py` cdylib, importable from Python as `dengjen_tashkeel_py`.

