Skip to main content

Karakalpak language toolkit for Python — Latin/Cyrillic script conversion, number-to-words, and string utilities

Project description

Kaalin

PyPI version Python License: MIT

A Python toolkit for the Karakalpak language: Latin-Cyrillic script conversion, number-to-words, and locale-aware string operations. Zero dependencies.

Quick Start

pip install kaalin
from kaalin.converter import latin2cyrillic, cyrillic2latin

print(latin2cyrillic("Assalawma áleykum"))  # Ассалаўма әлейкум
print(cyrillic2latin("Ассалаўма әлейкум"))  # Assalawma áleykum

Supported Features

Feature Description
Script Conversion Bidirectional Latin ↔ Cyrillic conversion with multi-character mapping (shш, chч) and special Cyrillic rules (ьиyi, ьоyo, ъеye)
Number to Words Converts integers and floats to Karakalpak words in Latin or Cyrillic script. Supports range 0 to 10³⁰, negative numbers, and decimal fractions
String Utilities Karakalpak-aware upper() / lower() that correctly handle the dotless ıÍ character pair
CLI Tools cyr2lat and lat2cyr commands for converting text files from the terminal

API Reference

Script Conversion

from kaalin.converter import latin2cyrillic, cyrillic2latin

latin2cyrillic("Qaraqalpaqstan")    # Қарақалпақстан
cyrillic2latin("Қарақалпақстан")    # Qaraqalpaqstan

Both functions accept a str and return a str. The converter handles uppercase, lowercase, and mixed-case text.

Number to Words

from kaalin.number import to_word, NumberRangeError

to_word(123)                     # bir júz jigirma úsh
to_word(999, num_type="cyr")     # тоғыз жүз тоқсан тоғыз
to_word(12.75)                   # on eki pútin júzden jetpis bes
to_word(-42)                     # minus qırıq eki

Parameters:

  • number (int | float) — the number to convert
  • num_type (str) — output script: "lat" (default) or "cyr"

Raises: NumberRangeError if number exceeds 10³⁰.

String Utilities

from kaalin.string import upper, lower

upper("Assalawma áleykum")   # ASSALAWMA ÁLEYKUM
lower("ASSALAWMA ÁLEYKUM")   # assalawma áleykum

Python's built-in str.upper() / str.lower() does not handle the Karakalpak dotless ı correctly. These functions fix that.

CLI Usage

Convert text files between scripts directly from the terminal:

# Cyrillic → Latin
cyr2lat input.txt              # writes input-lat.txt
cyr2lat input.txt output.txt   # writes output.txt

# Latin → Cyrillic
lat2cyr input.txt              # writes input-cyr.txt
lat2cyr input.txt output.txt   # writes output.txt

When to Use Kaalin

  • Converting Karakalpak text between Latin and Cyrillic scripts
  • Displaying numbers as Karakalpak words (invoices, checks, education)
  • NLP preprocessing for Karakalpak text (script normalization)
  • Building Karakalpak-language applications that need locale-aware string operations
  • Batch-converting text files via CLI

When NOT to Use Kaalin

  • Not a translator — it converts scripts (Latin ↔ Cyrillic), not languages
  • Not a spell-checker — it does not validate or correct Karakalpak text
  • Not for other Turkic languages — Kazakh, Uzbek, Turkish, etc. have different alphabets and rules
  • Not an OCR tool — it works with digital text, not images

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kaalin-3.3.2.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kaalin-3.3.2-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file kaalin-3.3.2.tar.gz.

File metadata

  • Download URL: kaalin-3.3.2.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for kaalin-3.3.2.tar.gz
Algorithm Hash digest
SHA256 84ca1377f5efffe167af74f2e5dad8f9bfb1fb9ec99b683b7f12aa9f706f53f7
MD5 33a46f10f0bc9b09e594e77707ed07f3
BLAKE2b-256 e65e34fccf732a9873b18f7c4957970b22494c5d6ccd5e85f931d7fbab54457f

See more details on using hashes here.

File details

Details for the file kaalin-3.3.2-py3-none-any.whl.

File metadata

  • Download URL: kaalin-3.3.2-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for kaalin-3.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 32710b759791603caca8bbd5d2e37b9062563491e4fcb8b9a9380caae385e99e
MD5 580a67b10b87bb2ee65729c4c0e9bfd6
BLAKE2b-256 202fc31c82a96b0f34b1e1cbdae338435f415eaccc4dc38dfb94b06c0e7706ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page