Skip to main content

tetrak-translit

Detect, transliterate and fold Armenian text. A dependency-free Python library and command-line tool for the problem every Armenian catalogue has: the same name exists in Armenian script in two orthographies and in four or five Latin spellings, and no stock search engine treats them as one word.

Status: alpha. The tables and the fold are tested against the set in tests/data/fold_cases.tsv; what is not in that set is not claimed. See known gaps.

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.fold("Yerevan") == tt.fold("Երեւան") == tt.fold("Erewan")
True
>>> tt.fold("Boghossian") == tt.fold("Պօղոսեան") == tt.fold("Poghosyan")
True
$ tetrak-translit detect "Ազգ եւ հայրենիք"
armenian (classical)	Ազգ եւ հայրենիք
$ tetrak-translit transliterate --scheme iso_9985 "Չարենց"
Čarenc'
$ tetrak-translit transliterate --scheme iso_9985 --to armenian "Čarenc'"
Չարենց
$ cut -f2 titles.tsv | tetrak-translit fold

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). Character ranges plus a few orthographic tells, chiefly a free ւ outside the ու digraph.

Transliteration, between Armenian and five named Latin schemes, each a versioned, tested table written from its published standard:

Key Scheme Where you meet it Reversible
ala_lc ALA-LC (2011) Library catalogues: Koha, WorldCat, the Library of Congress no
iso_9985 ISO 9985:1996 Data exchange; one letter per letter yes
bgn_pcgn BGN/PCGN 1981 Maps and place names: Yerevan, Gyumri no
hubschmann_meillet Hübschmann-Meillet Linguistics and classical scholarship yes
western Western Armenian pronunciation Diaspora names: Hagop, Kevork, Boghosian no

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, Armenian 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. It 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="armenian") works for ISO 9985 and Hübschmann-Meillet and raises for the rest.
  • Fold every popular spelling. Spellings that insert an unwritten schwa (Megerdich for Մկրտիչ) or come through Russian (Khachaturian for Խաչատրյան) do not fold to the Armenian, and a classical աւ that reformed spelling turned into օ does not either. The test set is the claim.

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, for two users at once: an Armenian cultural heritage aggregator that has to match catalogue records across scripts, and Tetrak's own Armenian 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).

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 0.1.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 0.1.0
File Size Uploaded Provenance Actions
tetrak_translit-0.1.0.tar.gz 139.2 kB With provenance Details for tetrak_translit-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 165.2 kB

Release files / tetrak_translit-0.1.0.tar.gz

Download URL tetrak_translit-0.1.0.tar.gz
Size 139.2 kB
Tags Source
SHA-256 checksum
How to use checksums
aada3c062fec3bf976fbb1f6496533839bfbd74a4664c94613a30cc4679db8c8
BLAKE2b-256 checksum
How to use checksums
57652653aa50b4ec7db015815890faaee80c9db154dcb5096a68017f48cee024
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 10, 2026.

Transparency log

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

Download URL tetrak_translit-0.1.0-py3-none-any.whl
Size 26.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0776414d2ec9a1cb74d65ccc097b9d8f0c4a458b53e3f4f0282b3e44515f215c
BLAKE2b-256 checksum
How to use checksums
c6c09448b24b569f7be1193e418f8fc12f0b2488da519abe9616be20d3f35023
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 10, 2026.

Transparency log

Security for tetrak-translit 0.1.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-0.1.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 10, 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