Skip to main content

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.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tetrak-translit 3.2.0
File Size Uploaded Provenance Actions
tetrak_translit-3.2.0.tar.gz 202.9 kB With provenance Details for tetrak_translit-3.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tetrak-translit 3.2.0
File Interpreter ABI Platform Actions
tetrak_translit-3.2.0-py3-none-any.whl Python 3 none any Details for tetrak_translit-3.2.0-py3-none-any.whl

Total release size: 253.0 kB

Release files / tetrak_translit-3.2.0.tar.gz

Download URL tetrak_translit-3.2.0.tar.gz
Size 202.9 kB
Tags Source
SHA-256 checksum
How to use checksums
214a172b16587a80f709c4bfd9812472cd19482e7db1e0171ffba79dca604827
BLAKE2b-256 checksum
How to use checksums
e4477b7fa19164ea87e814d9d76f772c998232401ef86665d24736c599c76956
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 16, 2026.

Transparency log

Release files / tetrak_translit-3.2.0-py3-none-any.whl

Download URL tetrak_translit-3.2.0-py3-none-any.whl
Size 50.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1600646f5fb7136e55d6a385582313f26decccf016c226d913a3ea76e85adc11
BLAKE2b-256 checksum
How to use checksums
c9a042d262fcd085300278faa8a981130fc9d7b2d032368d3cf1e65e0d55523f
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 16, 2026.

Transparency log

Security for tetrak-translit 3.2.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.

Select from 2 files

Attestation for tetrak_translit-3.2.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 16, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page