Karakalpak language toolkit for Python — Latin/Cyrillic script conversion, number-to-words, and string utilities
Project description
Kaalin
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 convertnum_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
Contributing
See CONTRIBUTING.md.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kaalin-3.3.1.tar.gz.
File metadata
- Download URL: kaalin-3.3.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01a9c49a35189c8c7a4653cc038ce3557167866e4d1972ddc834820a1d3c77ba
|
|
| MD5 |
d7eb1f20523f464c028a8725910347bf
|
|
| BLAKE2b-256 |
c5b987713d742ac159e508f2fe99a6bec4f3a96eed2ce6bfd8a24e07634b0fa5
|
File details
Details for the file kaalin-3.3.1-py3-none-any.whl.
File metadata
- Download URL: kaalin-3.3.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee1cfbeea983e3dcbe37c5ab6d7e0757434ff6b05d9a9996e2dbcce9449b2cac
|
|
| MD5 |
2d96f3a78a73dd276ccdfb7a3df54c2f
|
|
| BLAKE2b-256 |
fc3b946a4899661c4851a2aa9782be259410766c797d0ac0c608e5e04c24429a
|