Metadata-Version: 2.4
Name: penelopy
Version: 0.1.0
Summary: Pre-editorial normalization: a model-agnostic encapsulator for Latin/Old French normalizer models, with character-level alignment back to TEI standoff and W3C Open Annotation output.
Project-URL: Homepage, https://github.com/PonteIneptique/PENelopy
Project-URL: Repository, https://github.com/PonteIneptique/PENelopy
Project-URL: Documentation, https://ponteineptique.github.io/PENelopy/
Author: PONTE Thibault
License-Expression: MPL-2.0
License-File: LICENSE
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.10
Requires-Dist: click>=8.3
Requires-Dist: regex>=2025.11
Requires-Dist: tokenizers>=0.22
Requires-Dist: torch>=2.9
Requires-Dist: transformers<5,>=4.57
Provides-Extra: data
Requires-Dist: datasets>=3.0; extra == 'data'
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-click>=0.8; extra == 'docs'
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
Requires-Dist: mkdocs>=1.6; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.26; extra == 'docs'
Provides-Extra: lmstudio
Requires-Dist: openai>=1.0; extra == 'lmstudio'
Provides-Extra: notebook
Requires-Dist: jupyter>=1.0; extra == 'notebook'
Requires-Dist: matplotlib>=3.8; extra == 'notebook'
Requires-Dist: pandas>=2.0; extra == 'notebook'
Provides-Extra: onnx
Requires-Dist: optimum[onnxruntime]==2.1.0; extra == 'onnx'
Description-Content-Type: text/markdown

# PENelopy

Pre-editorial normalization toolkit for Latin and Old French: a model-agnostic
encapsulator around seq2seq normalizer models (currently
[`comma-project/normalization-byt5-small`](https://huggingface.co/comma-project/normalization-byt5-small)),
plus a character-level aligner that maps normalized output back onto the
original text to produce TEI standoff XML and W3C Open Annotation JSON.

## Install

```bash
uv add penelopy
# or, for the ONNX/quantized backend:
uv add "penelopy[onnx]"
```

## CLI

```bash
penelopy normalize input.txt --model comma-project/normalization-byt5-small
penelopy quantize --model comma-project/normalization-byt5-small --output .cache/onnx --quantize
penelopy evaluate predictions.txt references.txt
penelopy align "tãt.⁊si" "tant et si"

# Or normalize via any OpenAI-compatible chat server (e.g. LM Studio):
penelopy normalize input.txt --backend lmstudio --model google/gemma-4-12b \
  --base-url http://localhost:1234/v1 --no-think
```

## Library

```python
from penelopy.models import load_model
from penelopy.pipeline import normalize_document

model = load_model("comma-project/normalization-byt5-small")
result = normalize_document("tãt.⁊si lamoit", model)
print(result.tei)
print(result.annotations)
```

See the full developer documentation, including the module architecture,
at <https://ponteineptique.github.io/PENelopy/>.

## License

[Mozilla Public License 2.0](LICENSE).
