Skip to main content

Fast ISO 15919 transliteration for Indic scripts

Project description

Andhrica

Fast ISO 15919 transliteration for Indic scripts.

Supported Scripts

Code Script
te Telugu
ta Tamil
ml Malayalam
kn Kannada
or Odia
hi Hindi (with schwa deletion)
hi+ Hindi (aggressive schwa deletion)
sa Sanskrit (no schwa deletion)
gon Gunjala Gondi

Installation

pip install andhrica

Or install from source:

git clone https://github.com/neet2407/andhrica.git
cd andhrica
pip install -e .

Usage

from andhrica import transliterate

# Single string
transliterate("te", "తెలుగు")
# → 'telugu'

# Multiple strings
transliterate("ta", ["தமிழ்", "நன்றி"])
# → ['tamiḻ', 'naṉṟi']

File Processing

For large files with progress tracking:

from andhrica import transliterate_file
from andhrica.progress import progress_bar, print_stats

stats = transliterate_file(
    "te",
    "input.txt",
    "output.txt",
    on_progress=progress_bar()
)
print_stats(stats)

Output:

[████████████████████████████████████████] 100.0% │  45.2 MB/s │ hit 94.1%
──────────────────────────────────────────────────
  Bytes:      1,234,567,890
  Time:       27.32s
  Throughput: 45.2 MB/s
  Cache hit:  94.1%
──────────────────────────────────────────────────

Output Format

Uses ISO 15919 romanization with standard diacritics:

Type Characters
Long vowels ā ī ū
Retroflex ṭ ḍ ṇ ḷ
Sibilants ś ṣ
Nasals ṅ ñ ṁ
Aspirates kʰ gʰ cʰ jʰ ṭʰ ḍʰ tʰ dʰ pʰ bʰ
Vocalic R/L r̥ r̥̄ l̥ l̥̄

Examples

Script Input Output
Telugu తెలుగు telugu
Tamil தமிழ் tamiḻ
Malayalam മലയാളം malayāḷaṁ
Kannada ಕನ್ನಡ kannaḍa
Hindi हिन्दी hindī
Sanskrit संस्कृतम् saṃskr̥tam

API Reference

transliterate(lang, text)

Transliterate text to ISO 15919 romanization.

Parameters:

  • lang (str): Language code (te, ta, ml, kn, or, hi, hi+, sa, gon)
  • text (str | list): String or list of strings to transliterate

Returns: Transliterated string or list of strings

transliterate_file(lang, in_path, out_path, on_progress=None)

Stream-transliterate a file with optional progress callback.

Parameters:

  • lang (str): Language code
  • in_path (str): Input file path
  • out_path (str): Output file path
  • on_progress (callable, optional): Progress callback function

Returns: Stats object with processing details

License

MIT

Author

neet2407

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

andhrica-0.1.0.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

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

andhrica-0.1.0-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file andhrica-0.1.0.tar.gz.

File metadata

  • Download URL: andhrica-0.1.0.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for andhrica-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c5e033cd7482157cdf7395839ea0f76ce1b9914833e0129f16b5aa587da77b5e
MD5 c192b120328b03fd51b2bcb03570cc24
BLAKE2b-256 a3f2fffa956ed6be8b1c49284cb4b51e011dc809e6338678341feef8f103a632

See more details on using hashes here.

File details

Details for the file andhrica-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: andhrica-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for andhrica-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de6835c05c6f8a792f80cc43bcd4a4e42cc667514cd58282d3ebb0ca7b973d75
MD5 764bb2878d57e77228f2caf5006567a5
BLAKE2b-256 123d0702e113e5f334d1be770581caebc173617462d6d65d2ec6b0dd72d13519

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