tetrak-translit
Detect, transliterate and fold text in scripts that have several romanisations: Armenian and Georgian so far. A dependency-free Python library and command-line tool for the problem every catalogue of such material has: the same name exists in its own script, sometimes in more than one orthography, and in three or five Latin spellings, and no stock search engine treats them as one word.
Status: alpha. The tables and the folds are tested against the sets in
tests/data/; what is not in them is not claimed. See known gaps. The API may still change before 1.0.
pip install tetrak-translit
>>> import tetrak_translit as tt
>>> tt.detect("Երեւան").orthography
'classical'
>>> tt.transliterate("Երևան", "ala_lc")
'Erevan'
>>> tt.transliterate("Երևան", "bgn_pcgn")
'Yerevan'
>>> tt.transliterate("Յակոբ", "western")
'Hagop'
>>> tt.transliterate("თბილისი", "national")
'tbilisi'
>>> tt.fold("Yerevan", script="hy") == tt.fold("Երեւան") == tt.fold("Erewan", script="hy")
True
>>> tt.fold("Boghossian", script="hy") == tt.fold("Պօղոսեան") == tt.fold("Poghosyan", script="hy")
True
>>> tt.fold("Chavchavadze", script="ka") == tt.fold("ჭავჭავაძე") == tt.fold("Ch'avch'avadze", script="ka")
True
$ tetrak-translit detect "Ազգ եւ հայրենիք" "თბილისი"
armenian (classical) Ազգ եւ հայրենիք
georgian თბილისი
$ tetrak-translit transliterate --scheme iso_9985 "Չարենց"
Č'arenc'
$ tetrak-translit transliterate --scheme iso_9984 --to script "Tbilisi"
თბილისი
$ cut -f2 titles.tsv | tetrak-translit fold --script hy
Three jobs
Detection. Which script a string is in and, for Armenian, which
orthography: classical (everything printed before the 1922 reform, and
the diaspora still), reformed (Soviet and post-Soviet Armenia) or
indeterminate (the string reads the same under both). Unicode character
names plus a few orthographic tells, chiefly a free ւ outside the ու
digraph.
Transliteration, between a script and its named Latin schemes, each a versioned, tested table written from its published standard:
| Id | Scheme | Where you meet it | Reversible |
|---|---|---|---|
hy/ala_lc |
ALA-LC Armenian (2022) | Library catalogues: Koha, WorldCat, the Library of Congress | no |
hy/iso_9985 |
ISO 9985:2026 | Data exchange; one letter per letter | yes |
hy/iso_9985_1996 |
ISO 9985:1996, superseded | Reading data romanised under the first edition | yes |
hy/bgn_pcgn |
BGN/PCGN 1981 | Maps and place names: Yerevan, Gyumri | no |
hy/hubschmann_meillet |
Hübschmann-Meillet | Linguistics and classical scholarship | yes |
hy/western |
Western Armenian pronunciation | Diaspora names: Hagop, Kevork, Boghosian | no |
ka/ala_lc |
ALA-LC Georgian (2011) | Library catalogues | no |
ka/iso_9984 |
ISO 9984:2026 | Data exchange; the national system made reversible | yes |
ka/iso_9984_1996 |
ISO 9984:1996, superseded | Reading data romanised under the first edition | yes |
ka/national |
Georgian national system (2002) | Road signs, passports, maps: Tbilisi, Kutaisi | no |
A scheme key alone is enough when the text or the key settles the script;
otherwise say script="ka" or use the qualified id. Reversible where the
standard is one-to-one; the others are documented as lossy and the library
refuses to guess rather than reverse them.
The canonical fold. One function that maps any of the above, script or Latin, onto a single index form, so that index-time and query-time normalisation agree. This is what a Solr or Elasticsearch analysis chain calls. Each script owns its rules, because what should be merged differs (Armenian folds b with p, Georgian must not), so Latin input names the script it is to be folded for. The Armenian fold generalises the script fold in Tetrak's Armenian recogniser and takes the orthography findings of Tetrak brief 014 as its first test cases.
The schemes are for display; the fold is for finding. A fold key is
a deliberately coarse ASCII skeleton (poghosian, kevork, haiastan)
and must never be shown to a reader. Cross-script name-matching research
(LREC 2020) finds there is often no gold form to score against, and this
package does not pretend there is one.
What it does not do
- Translate. Transliteration is the same words in different letters.
- Guess at lossy reversals.
transliterate(..., to="script")works for ISO 9985, Hübschmann-Meillet and ISO 9984 and raises for the rest. - Fold every popular spelling. Spellings that insert an unwritten
schwa (Megerdich for
Մկրտիչ), come through Russian (Khachaturian forԽաչատրյան, Tiflis forთბილისი) or are translations (George forგიორგი) do not fold to the script, and a classical Armenianաւthat reformed spelling turned intoօdoes not either. The test sets are the claim. - Handle every script. Armenian and Georgian so far. The engine is script-agnostic and a new script is a package of tables; see adding a script.
Documentation
The user guide and API reference are at scattercode.github.io/tetrak-translit, built from the released code at each release.
Where it comes from
Built as part of Tetrak, a local-first OCR pipeline for archival material, to support two use cases at once: a catalogue search that has to match records across scripts, and Tetrak's own transcripts, where an ALA-LC rendering beside the OCR output is both a catalogue-ready field and an accessibility one (a screen reader with no Armenian voice can at least read the romanisation). Georgian came next because Tetrak's recognisers are heading there; Syriac is planned.
Contributing and licence
See CONTRIBUTING.md for the checks, the commit style and the release automation, and SECURITY.md for reporting a vulnerability. MIT licensed — see LICENSE.
Metadata
Release files for tetrak-translit 3.0.0
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 |
|---|---|---|---|---|
| tetrak_translit-3.0.0.tar.gz | 196.7 kB | With provenance | Details for tetrak_translit-3.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tetrak_translit-3.0.0-py3-none-any.whl | Python 3 | none | any | Details for tetrak_translit-3.0.0-py3-none-any.whl |
Total release size: 245.3 kB
Release files / tetrak_translit-3.0.0.tar.gz
| Download URL | tetrak_translit-3.0.0.tar.gz |
|---|---|
| Size | 196.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f51eb85305435c2d82e3544a6129b379ca23d217600b91de342c78a33948a503
|
|
BLAKE2b-256 checksum How to use checksums |
d5d0e7040e4d2c7a8337e1158a2089b4a86c9f051055c327d1f1a053a739a3d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 12, 2026.
Transparency logRelease files / tetrak_translit-3.0.0-py3-none-any.whl
| Download URL | tetrak_translit-3.0.0-py3-none-any.whl |
|---|---|
| Size | 48.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
68b33dc97c3808e43c0ed9769632fdcaf3fce66b1b612886e814a3f57005e701
|
|
BLAKE2b-256 checksum How to use checksums |
4d9607f3e02087ef221c90d6adc7f10d47466d184c12eedc3544b04f1440462d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 12, 2026.
Transparency logSecurity for tetrak-translit 3.0.0
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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for tetrak_translit-3.0.0.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 Oct 12, 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.