Skip to main content

tamil-toolkit for Python

High-Performance Tamil NLP, Text Processing & Unicode Library for Python

Blazing fast Rust-backed Tamil NLP · Grapheme & Syllable segmentation · Agara varisai sorting · Legacy font conversion (Bamini, TSCII, TAB, TAM, Vanavil) · Currency & Numerals · Panchangam calendar

PyPI version PyPI monthly downloads CI Apache-2.0 license Python 3.11+ CPython abi3

Install · Quick Start · Key Capabilities · Feature Comparison · Documentation · License


tamil-toolkit is the premier, high-performance Tamil language and NLP library for Python 3.11+. Powered under the hood by memory-safe, zero-cost Rust abstractions, it brings deterministic, microsecond-level Tamil computational linguistics to Python data scientists, NLP researchers, web developers, and automation engineers.

Pre-built binary wheels using the stable CPython abi3 interface are provided for Windows, macOS (Apple Silicon and Intel x86_64), and Linux. Installation is instantaneous with zero compiler dependencies.


What is Included

Domain Python Capabilities
🔤 Unicode & Letters NFC/NFD normalization, tailored Tamil letter segmentation (get_letters), Mei/Uyir splitting, and scalar inspection. Correctly handles ligatures like க்ஷ and ஸ்ரீ.
🧩 Word & Sentence Tokenization Offline, source-preserving word and sentence spans (tokenize_words, segment_sentences) with exact UTF-8 byte & written-unit offsets, attested Tamil abbreviations (திரு., மு.க., பி.ப., மு.ப., எ.கா., ரூ.), and opt-in stopword profiles (none, conservative, broad).
🎵 Phonology & Prosody Tholkappiyam-grounded phonology: exact mora (Maathirai) duration calculation, letter quantity classification (is_kuril, is_nedil, is_mei, is_otru, is_aytham), stop-nasal cognates (Ina Ezhuthu via get_cognate, are_cognates), and zero-allocation syllable nuclei (Olippasai).
🔄 Legacy Font Transcoder Universal bidirectional transcoding between Unicode and legacy Tamil encoding formats: Bamini, TSCII, TAB, TAM, Anjal, Vanavil Avvaiyar, and LT-TM / IndoWord.
🔠 Agara Varisai Collation Traditional Tamil dictionary alphabetical sorting (Agara Varisai) with stable Mei-first collation order and versioned sort/search keys.
🔢 Numerals & Currency Bounded Tamil Nadu (ta-IN) and Sri Lankan (ta-LK) number-to-words conversion, exact financial currency formatting (INR/LKR) with zero floating-point drift, rational fractions, and Gregorian civil dates.
📅 Solar Calendar & Panchangam Classical Thirukanitham Drik and 1962 Vākyakaraṇa calendar models: Gregorian ↔ Tamil solar date conversion, 60-year Jovian cycles, and five-limb astronomical panchangam calculations.

Why tamil-toolkit for Python?

Unlike legacy pure-Python packages (such as open-tamil), tamil-toolkit is engineered for production workloads:

  • ⚡ 10x to 50x Faster: Core algorithms run in compiled Rust via the C-ABI with zero Python interpreter overhead.
  • 🎯 Linguistic Accuracy: Adheres strictly to Unicode UAX #29, CLDR 49, and classical grammatical treatises (Tolkappiyam).
  • 🛡️ Zero Floating Point Drift: Currency formatting uses exact integer minor-unit math (e.g. paisa/cents) rather than imprecise IEEE-754 floats.
  • 📦 Instant Installation: Pre-compiled binary wheels for all major platforms (Windows, macOS x86_64/ARM64, Linux glibc/musl).

Install

python -m pip install tamil-toolkit==0.2.0

Quick Start

1. Accurate Tamil Letter Segmentation

Python's built-in len() or string slicing breaks compound Tamil grapheme clusters. tamil-toolkit treats each Tamil letter (including vowel modifiers and atomic ligatures like க்ஷ and ஸ்ரீ) as a unified glyph:

import tamil_toolkit as tamil

text = "தமிழ்நாடு"
letters = tamil.get_letters(text)
print("Letter count:", len(letters))  # 5 (not 10!)
print("Letters:", letters)            # ['த', 'மி', 'ழ்', 'நா', 'டு']

# Correct handling of complex Grantha ligatures
shree = "ஸ்ரீலங்கா"
print(tamil.get_letters(shree))       # ['ஸ்ரீ', 'ல', 'ங்', 'கா']

2. Legacy Font Transcoder (Bamini, TSCII, TAB, TAM, Vanavil)

Convert legacy digitized archives, PDF extractions, and older websites into modern Unicode:

import tamil_toolkit as tamil

# Bamini font to Unicode
bamini_text = "jkpo;ehL"
unicode_text = tamil.bamini_to_unicode(bamini_text)
print(unicode_text)  # தமிழ்நாடு

# Unicode back to Bamini
print(tamil.unicode_to_bamini("வணக்கம்"))  # tzf;fk;

# Advanced transcoders via the unified execute() dispatcher
# TSCII bytes to Unicode:
tscii_data = [0xba, 0xa2, 0xc5, 0xfd]
restored = tamil.execute({
    "op": "tscii_bytes_to_unicode",
    "input": {"bytes": tscii_data}
})
print("From TSCII:", restored)

# Vanavil Avvaiyar font to Unicode:
vanavil_result = tamil.execute({
    "op": "vanavil_text_to_unicode",
    "input": {"text": "jkpo;"}
})

3. Number to Tamil Words & Cheque Currency Formatting

Format numbers for banking, legal cheques, invoices, and formal documents:

import tamil_toolkit as tamil

# Exact currency formatting without floating-point errors (input in minor units: cents/paisa)
# 102550 minor units = 1,025.50
inr = tamil.format_currency(102550, "INR", "TN")
print("Tamil Nadu INR:", inr)  # INR 1,025.50

lkr = tamil.format_currency(102550, "LKR", "SL")
print("Sri Lanka LKR:", lkr)   # LKR 1,025.50

# Rational fraction formatting
print(tamil.format_fraction(2, 4))  # 1/2

4. Agara Varisai Dictionary Collation

Sort lists and datasets according to traditional Tamil lexicographical ordering:

import tamil_toolkit as tamil

words = ["ஆப்பிள்", "அணில்", "ஔவையார்", "இலை", "ஈட்டி", "உரல்"]
sorted_words = tamil.sort_words(words)
print("Agara Varisai:", sorted_words)
# Output: ['அணில்', 'ஆப்பிள்', 'இலை', 'ஈட்டி', 'உரல்', 'ஔவையார்']

# Compare two words
print(tamil.compare("அம்மா", "அப்பா"))  # -1 (அம்மா comes before அப்பா)

5. Phonology, Mora (Maathirai) & Cognates (Ina Ezhuthu)

Analyze poetic prosody and phonetic properties:

import tamil_toolkit as tamil

# Letter Quantity Classification
assert tamil.is_kuril("அ") == True
assert tamil.is_nedil("ஆ") == True
assert tamil.is_mei("க்") == True
assert tamil.is_otru("க்") == True
assert tamil.is_aytham("ஃ") == True

# Exact Mora (Maathirai) calculation
# த (1.0) + மி (1.0) + ழ் (0.5) = 2.5
mora = tamil.baseline_maathirai("தமிழ்")
print("Maathirai for 'தமிழ்':", mora)  # 2.5

# Homorganic Stop-Nasal Cognates (Ina Ezhuthu)
assert tamil.get_cognate("க்") == "ங்"
assert tamil.get_cognate("ச்") == "ஞ்"
assert tamil.get_cognate("தூ") == "நூ"
assert tamil.are_cognates("ட்", "ண்") == True

6. Source-Preserving Word & Sentence Tokenization

Split Tamil text into words and sentences while preserving exact UTF-8 byte and written-unit offsets and keeping attested abbreviations intact:

import tamil_toolkit as tamil

text = "திரு. குமார் மற்றும் ரூ.100 வந்தது."
words = tamil.tokenize_words(text, stopword_profile="conservative")
sentences = tamil.segment_sentences(text)
print(len(words), len(sentences))

0.2.0 scope

The PyPI 0.2.0 package includes the capabilities listed above. The shared execute API exposes lt_tm_codes_to_unicode, lt_tm_text_to_unicode, unicode_to_lt_tm_codes, and unicode_to_lt_tm_text. LT-TM conversion handles selected 16-bit code sequences; it does not parse PDFs, select font runs, or detect encodings. The profile does not claim complete historical-font coverage. APIs may change.

Other planned linguistic modules, the private PDF extraction utility, and Dart/Pub distribution are not published.

import tamil_toolkit as tamil

codes = tamil.execute({"op": "unicode_to_lt_tm_codes", "input": {"text": "தமிழ்"}})
text = tamil.execute({"op": "lt_tm_codes_to_unicode", "input": {"codes": codes}})

Author & Maintainer

Abishtakan Sivachandrathevan (@abishtakan)


Documentation

The wheels target CPython 3.11+ through the stable abi3 interface. Source builds require Rust 1.85+. See the 0.2.0 release record for artifact details.


License

Original code is Apache-2.0 licensed (see NOTICE). Bundled data and mappings retain their recorded terms in the third-party notices.


Keywords & Search Queries

tamil nlp python, python tamil text processing, bamini to unicode python, tscii to unicode converter python, tamil numerals spellout python, tamil sort agara varisai, tamil letter segmentation python, tamil panchangam calendar python, tamil unicode normalizer, open-tamil alternative, fast tamil library python.

Metadata

Release files for tamil-toolkit 0.2.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 tamil-toolkit 0.2.0
File Size Uploaded Provenance Actions
tamil_toolkit-0.2.0.tar.gz 32.4 MB With provenance Details for tamil_toolkit-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for tamil-toolkit 0.2.0
File Interpreter ABI Platform Actions
tamil_toolkit-0.2.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for tamil_toolkit-0.2.0-cp311-abi3-win_amd64.whl
tamil_toolkit-0.2.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for tamil_toolkit-0.2.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
tamil_toolkit-0.2.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for tamil_toolkit-0.2.0-cp311-abi3-macosx_11_0_arm64.whl

Total release size: 38.9 MB

Release files / tamil_toolkit-0.2.0.tar.gz

Download URL tamil_toolkit-0.2.0.tar.gz
Size 32.4 MB
Tags Source
SHA-256 checksum
How to use checksums
ff08d0298f159efe74789d9ba41767af67307192e90c9182386f1c5b99d0d07d
BLAKE2b-256 checksum
How to use checksums
35516c69db7832d9c035ddd4b05660351eb422f30e8f8541f422c92975f2ecd1
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 Nov 26, 2026.

Transparency log

Release files / tamil_toolkit-0.2.0-cp311-abi3-win_amd64.whl

Download URL tamil_toolkit-0.2.0-cp311-abi3-win_amd64.whl
Size 2.0 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7959c6253b73d1018a2c29e37d9b70974f7d4a07bf627a7853252835683fc3fa
BLAKE2b-256 checksum
How to use checksums
7f73a777f1248284c1624c5f7e693c7159a42b3666faf4d3e558329598a806de
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 Nov 26, 2026.

Transparency log

Release files / tamil_toolkit-0.2.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL tamil_toolkit-0.2.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.4 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
112de9116795c9c3f159d20498713150fda0311f6183f18a7956ee79acc6bba0
BLAKE2b-256 checksum
How to use checksums
75e3a843797d7290bdb6366b0b7bcd55ade0afbccd73b3c4e09d3ee4962d9cac
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 Nov 26, 2026.

Transparency log

Release files / tamil_toolkit-0.2.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL tamil_toolkit-0.2.0-cp311-abi3-macosx_11_0_arm64.whl
Size 2.1 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9fdec7d095ccf6afe9f9b760483e8b5be7594cb3935128805db6b5eaafe03219
BLAKE2b-256 checksum
How to use checksums
1557f1953bd43963e09a72f6273457738fd1d6639de72368c1207c4583109c66
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 Nov 26, 2026.

Transparency log

Security for tamil-toolkit 0.2.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 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for tamil_toolkit-0.2.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 Nov 26, 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