Skip to main content

AnbaniPy

tests codecov PyPI Python versions License: GPL v3

Georgian Python toolkit for NLP, Transliteration and more. Partially based on anbani.js.

Install

pip install anbani

Transliteration and NLP utilities need only hjson. PDF / e-book extraction (anbani.nlp.utils.ebook2text) additionally requires PyMuPDF:

pip install anbani[pdf]

Quickstart

Transliteration example:

from anbani.core.converter import convert, interpret

interpret("გამარჯობა", "asomtavruli")

# 'ႢႠႫႠႰႿႭႡႠ'

Georgianisation example:

from anbani.nlp.georgianisation import georgianise

georgianise("gamarjoba - rogor xar - rasa iqm - kaia kata - kai erti")

# 'გამარჯობა - როგორ ხარ - რასა იქმ - კაია კატა - კაი ერთი'

Convert ebooks with qwerty encoding to unicode Mkhedruli:

from anbani.nlp.utils import ebook2text
from anbani.core.converter import classify_text
from anbani.core.converter import convert

text = ebook2text("/home/george/Dev/georgian-text-corpus/sources/mylibrary/raw/files/ჩარლზ დიკენსი - დევიდ კოპერფილდი.pdf")
print(text[:300])

print(classify_text(text))

print(convert(text, "qwerty", "mkhedruli")[:300])

# Carlz dikensi daviT koperfildi Tavi pirveli dabadeba me viqnebi gmiri Cemive sakuTari Tavgadasavlisa Tu sxva...

# latin

# ჩარლზ დიკენსი დავით კოპერფილდი თავი პირველი დაბადება მე ვიქნები გმირი ჩემივე საკუთარი თავგადასავლისა თუ სხვა...

Expand contractions:

from anbani.nlp.contractions import expand_text

text = "ილია ჭავჭავაძე (დ. 8 ნოემბერი, 1837, სოფელი ყვარელი — გ. 12 სექტემბერი, 1907, წიწამური)"

print(text)
print(expand_text(text))

# ილია ჭავჭავაძე (დ. 8 ნოემბერი, 1837, სოფელი ყვარელი — გ. 12 სექტემბერი, 1907, წიწამური)
# ილია ჭავჭავაძე (დაბადება 8 ნოემბერი, 1837, სოფელი ყვარელი — გარდაცვალება 12 სექტემბერი, 1907, წიწამური)

Contract them back:

from anbani.nlp.contractions import contract_text

print(contract_text("მასის ატომური ერთეული და ასე შემდეგ"))

# მ.ა.ე. და ა.შ.

Text statistics & lorem

from anbani import toolkit, lorem

toolkit.frequency("ანბანი")   # per-letter frequencies
toolkit.friedman(text)         # index of coincidence
lorem.sentences(12)            # fake Georgian prose
lorem.names(3)                 # fake full names

Command line

Installing the package also installs an anbani command:

anbani interpret "gamarjoba"                      # -> ᲒᲐᲛᲐᲠᲯᲝᲑᲐ
anbani convert "ანბანი" -f mkhedruli -t asomtavruli
anbani georgianise "gamarjoba"
anbani expand "ვნახოთ ა. შ."
anbani lorem -w 8

Interactive TUI

New in 3.1: a full-screen terminal UI. Launch it with anbani tui (or python -m anbani tui). Zero extra dependencies — it is hand-rolled ANSI, and imports stay lazy so import anbani and the plain CLI are unaffected.

anbani tui

anbani tui — loading splash

Five tabs, switch with 1–5 or tab / shift+tab:

Tab What it does
Converter live transliteration; m toggles auto/manual, f/o pick source/target, s swaps
Alphabet letter grid + detail card; hjkl to move, c cycles script, a toggles archaic, enter copies
Lorem fake Georgian text; k kind, +/- amount, g generate
NLP georgianise / latinise / expand / contract; m mode, b georgianise level (fast/balanced/accurate)
Toolkit letter-frequency bars + Friedman index of coincidence

Converter — live transliteration with script auto-detection:

Converter tab

Alphabet — grid + per-letter detail across every Georgian script, IPA, braille, numeral:

Alphabet tab

NLP — georgianise / latinise / expand / contract:

NLP tab

Toolkit — letter-frequency bars and the Friedman index of coincidence:

Toolkit tab

Global keys: ? help overlay · i/enter edit · y copy (via OSC 52) · q or ctrl+c quit. Minimum terminal size is 60×16.

Notes:

  • No Georgian keyboard? Pick from: qwerty in the Converter (type Latin, get Georgian), or paste — bracketed paste is supported in edit mode.
  • Copy uses OSC 52; some terminals block it, in which case the copy silently does nothing.
  • Not supported on native Windows (needs a POSIX terminal); use WSL or the npm package there.

Parity with anbani.js

anbani.py and anbani.js share one behavior contract, proved in CI by the byte-identical spec/golden.json that both test suites run. As of 3.0 they are feature-equivalent; the only intentional gaps are ebook2text (Python-only, needs PyMuPDF) and the browser/UMD bundle (js-only).

3.4

Table fixes, each backed by a source in docs/table-sources.md.

  • New national_simplified: the apostrophe-free national system (State Language Department guidelines).
  • Letters with no counterpart in the target table are kept, no longer dropped (ჶ–ჿ in Asomtavruli/Nuskhuri, ჱ–ჵ in the 33-letter Latin tables).
  • Asomtavruli Ⴧ Ⴭ and Nuskhuri ⴧ ⴭ (YN, AEN) added, converted and detected.
  • cyrillic: ფ п, წ ц, ჭ ч (GUGK 1972). greek: ფ π, ხ χ, გ γκ, ი ι, ძ τζ, heta dropped from შ ყ ჭ. armenian: ყ ղ.
  • phonetic: ejectives all ʼ (U+02BC), ჱ ej, ჽ æ, ჼ a bare combining tilde. iso_9984 (the 1996 edition): ჴ ẖ. titus: ძ ʒ. bgn (1981): no archaic letters.
  • classify_text reports "braille" and interpret accepts braille input.
  • georgianise: hyphenated words no longer keep their <…> markers.
  • New toolkit.numeric_value(text): the sum of the letters' numeral values (ჩქ → 1600); the numeric target still writes each letter's value.

3.0 — breaking changes

  • classify_text returns "unknown" for undetectable / mixed-script text and now reports the four bicameral scripts; interpret raises on "unknown".
  • convert / interpret raise ValueError on an unsupported source or target (was an assertion, or a silent passthrough for targets).
  • georgianise defaults to mode="balanced" (was "accurate").

To-Do

Feel free to fork this repo!

  • Tokenizer
  • Transliteration
  • Expand contractions
  • ebook2text converter
  • Stemmer
  • Lemmatizer
  • Stopwords

Resources used

Metadata

Release files for anbani 3.4.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 anbani 3.4.0
File Size Uploaded Provenance Actions
anbani-3.4.0.tar.gz 745.2 kB With provenance Details for anbani-3.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anbani 3.4.0
File Interpreter ABI Platform Actions
anbani-3.4.0-py3-none-any.whl Python 3 none any Details for anbani-3.4.0-py3-none-any.whl

Total release size: 1.5 MB

Release files / anbani-3.4.0.tar.gz

Download URL anbani-3.4.0.tar.gz
Size 745.2 kB
Tags Source
SHA-256 checksum
How to use checksums
896f9d701a4380c1663c78e9d56639d7200a19c6f28c79f929c7bb1d481d6b16
BLAKE2b-256 checksum
How to use checksums
c751ad13ea658566889f9e6b6d4c503d3e07843900530975719487d5019ca050
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 Oct 25, 2026.

Transparency log

Release files / anbani-3.4.0-py3-none-any.whl

Download URL anbani-3.4.0-py3-none-any.whl
Size 748.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7381cb4d381aa8aed6b8adeb5815fd24258dc1b57123b86afc57026ab0dfaa8
BLAKE2b-256 checksum
How to use checksums
00e088f7f3a498354dfbd5e70fdb6891f034d34fe632c956b61da53820008f41
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 Oct 25, 2026.

Transparency log

Security for anbani 3.4.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for anbani-3.4.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 25, 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