This release is a pre-release and may not be stable for production use.
glyphly
OCR for Python with nothing to install but the package. Reads scans, photos and
images into text, with every word's position and confidence. No Tesseract, no OpenCV, no
system programs: pip install glyphly brings NumPy, Pillow and ONNX Runtime, all as
wheels for Windows, macOS and Linux.
Pre-alpha. The engine works and is measured, but the API may change and it is not on PyPI yet. Feedback is very welcome.
import glyphly
page = glyphly.read("scan.png") # path, bytes, PIL image or NumPy array
print(page.text) # lines in reading order
print(page.confidence) # 0..1, character-weighted
for word in page.lines[0].words:
print(word.text, word.box, word.confidence) # box = (x0, top, x1, bottom) in pixels
glyphly read scan.png # text
glyphly read scan.png --json # lines, words, boxes, confidences
glyphly download # fetch the model files now, for offline use later
For many images, create one glyphly.Reader() and call reader.read(...) on each: the
models load once.
How it works
- Find text lines. A small segmentation network (PP-OCRv6 detection) marks text pixels. glyphly's own post-processing, written in NumPy, groups them into lines and measures each line's direction, so tilted pages (skewed scans, phone photos) are cut out straight instead of slicing through neighbouring lines.
- Read each line. A recognition network (PP-OCRv6) reads each straightened line at its full width (no width cap, so long lines and wide fonts are not squeezed), and CTC decoding turns its output into characters.
- Locate words. Each character comes from a known column of the line, so every word gets its own box on the page.
The model files (31 MB) are downloaded once into ~/.cache/glyphly (or GLYPHLY_HOME) and
checked against a pinned SHA-256 fingerprint before use. They come from PaddleOCR via the
RapidOCR project, both Apache-2.0 (see NOTICE). Replacing the recognition model
with one trained by this project is on the roadmap.
Accuracy
Measured with bench/ocr.py on pages rendered from known text in 5 fonts, so the ground
truth is exact. Held-out test split (pages never used while building), character error
rate, lower is better:
| glyphly | gleanly + Tesseract | RapidOCR (same models) | plain Tesseract | |
|---|---|---|---|---|
| Standard: clean, fax, blur, noise, 3° skew, JPEG, faint + shadow, phone photo (120 pages) | under 0.05% | 0.6% | 5.1% | 16.1% |
| Hard: small print, white on dark, colour, perspective, cheap scan, two columns, table (105 pages) | 0.1% | 0.0% | 15.1% | 0.5% |
Two columns are read one after the other and tables row by row (each row on one line). Weak spot left on the hard suite: cheap scans (0.3%). These are generated pages: real scans and a comparison with docTR, EasyOCR, PaddleOCR and a paid OCR service come next (see docs/review.md).
Languages
glyphly.read() works out the script by itself: Latin-script languages, Chinese and
Japanese are read by the default model; lines that look misread are re-read with the
matching script model (downloaded the first time a page needs it, about 8 MB each, checked
by SHA-256), right-to-left lines are put in reading order, and numbers skipped by the
Arabic-script model are read back in. Or choose: Reader(lang="ru"),
Reader(lang=["hi", "en"]), glyphly read scan.png --lang ar; glyphly download --all
fetches every model for offline use.
Measured with bench/languages.py (the same short notice with a date and an amount,
written in each language and drawn by a browser so every script is shaped correctly),
character error rate:
| Script | Languages measured | CER |
|---|---|---|
| Latin | English, German, French, Spanish, Portuguese, Polish, Turkish | 0% |
| Latin | Vietnamese | 5.4% (stacked accents dropped) |
| Chinese, Japanese, Korean | zh, ja, ko | 0% |
| Greek, Thai, Tamil | el, th, ta | 0% |
| Cyrillic | Russian, Ukrainian | 5.0%, 1.2% |
| Devanagari, Telugu | Hindi, Telugu | 1.4%, 4.2% |
| Arabic script | Arabic, Persian | 5.3%, 6.3% |
| Not supported yet | Hebrew, Bengali (and other scripts without an open model) | 83%, 76% |
Average over the 20 supported languages: 1.4%. One sentence per language is a smoke test, not a full benchmark: real documents per language are on the roadmap.
Status and roadmap
- Engine on ONNX Runtime with no system dependencies; rotated lines; word boxes
- Held-out and hard-suite results; two-column reading order; table rows
- 20 languages in 11 scripts, detected automatically
- Table structure (cells), page orientation, real-scan benchmark
- Hebrew, Bengali and other scripts without an open model
- Release on PyPI; used by gleanly for OCR
- glyphly's own trained recognition model
- Real-scan benchmark; comparison with Docling, Marker and a paid OCR service
Development
uv sync # package + dev tools
uv run glyphly download # model files
uv run pytest
uv sync --group bench # + RapidOCR baseline; gleanly[ocr] and Tesseract optional
uv run python -m bench.ocr --split dev
License
Metadata
Release files for glyphly 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| glyphly-0.1.0a1.tar.gz | 43.1 kB | With provenance | Details for glyphly-0.1.0a1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| glyphly-0.1.0a1-py3-none-any.whl | Python 3 | none | any | Details for glyphly-0.1.0a1-py3-none-any.whl |
Total release size: 72.3 kB
Release files / glyphly-0.1.0a1.tar.gz
| Download URL | glyphly-0.1.0a1.tar.gz |
|---|---|
| Size | 43.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2baa8be7eaf215c927fca9a6a3817825b49f3ffe992813c2131a2c4187f90632
|
|
BLAKE2b-256 checksum How to use checksums |
1c1c041712aa10fed68659752ef80e4fb1da96dae458ef552e80c3ee125fa370
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logRelease files / glyphly-0.1.0a1-py3-none-any.whl
| Download URL | glyphly-0.1.0a1-py3-none-any.whl |
|---|---|
| Size | 29.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4703082acd443ef52b6d789a315ce0c39381f4b554de75982364c50eeb2cca0d
|
|
BLAKE2b-256 checksum How to use checksums |
25ecd762afd67985fd41d124b841e75ea2b17a4ff90cfe5acaa5b094c4355315
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logSecurity for glyphly 0.1.0a1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for glyphly-0.1.0a1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.