uccharan (Python)
Phonemiser, text normaliser, transliterator and pronunciation engine for text-to-speech and speech recognition: 39 languages (English, Hindi, nineteen more South Asian languages and seventeen European ones), in Rust, Python, JavaScript and C. Apache-2.0, no GPL code or data. (what it does · measurements)
- Phonemes in the shapes Piper, Kokoro, Kitten TTS, Matcha-TTS and sherpa-onnx voices expect, compatible with the espeak-ng output those voices were trained on; an improved mode for voices you train yourself.
- Normalise-only mode: the spoken form of numbers, money, dates and URLs for voices that read text, with spans aligned to the input.
- Transliteration of romanised Hindi, Marathi, Bengali, Tamil, Telugu, Gujarati, Punjabi, Kannada and Malayalam into native script.
- Pronunciation word lists, sound-alike matching of a recogniser's output against your vocabulary, and tools for training voices.
uv add uccharan # or: uv pip install uccharan
pip install uccharan
import uccharan
uccharan.phonemize("Hello, world.") # 'həlˈoʊ, wˈɜːld.'
uccharan.phonemize("नमस्ते दुनिया", lang="hi") # 'nəmˈʌsteː dˈʊnɪjˌaː'
uccharan.phonemize("Hi there. Bye!", "en-us", "piper") # ['hˈaɪ ðˈɛɹ.', 'bˈaɪ!']
uccharan.phonemize("Hi there.", "en-us", "sherpa-onnx") # [[104, 712, 97, 618, …]]
uccharan.phonemize("I read it yesterday.", improved=True) # 'aɪ ɹˈɛd ɪt jˈɛstɚdˌeɪ.'
uccharan.phonemize("I read the book.", "en-us", "kokoro") # 'ˌI ɹˈɛd ðə bˈʊk.' (misaki conventions, for Kokoro)
uccharan.phonemize_batch(lines, "hi") # all cores, GIL released
uccharan.normalize("Rs. 250 on 3/4/2024", "en-us").text # 'two hundred fifty rupees on March fourth twenty twenty four'
uccharan.normalize("₹5 करोड़ का सौदा 10:30 बजे", "hi").text # 'पांच करोड़ रुपये का सौदा साढ़े दस बजे'
uccharan.load_pack("xlit-hi") # CC BY-SA 4.0 pack, downloaded once
uccharan.transliterate("mujhe kal office jana hai", "hi").text # 'मुझे कल office जाना है'
names = uccharan.SoundIndex(["Kothari", "Paytm"])
names.apply("send it to Coat Harry", "en-us").text # 'send it to Kothari'
For code written against phonemizer:
from uccharan.compat import EspeakBackend
backend = EspeakBackend("en-us", preserve_punctuation=True, with_stress=True)
backend.phonemize(["Hello, world."], strip=True) # ['həlˈoʊ, wˈɜːld.']
A command-line program is installed as uccharan (uccharan -l hi -p piper "नमस्ते").
Guides: normalise-only mode, word lists, sound-alike matching, transliteration, languages.
For training voices and checking pronunciation, uccharan.train and the uccharan-train command
label a dataset (training-ready phonemes for Piper, Matcha-TTS and icefall-style recipes, a symbol
table and a voice.json), choose a reading script, report phoneme and diphone coverage, and score
a recogniser's output against a reference word by word
(guide).
English for Kokoro uses a port of misaki with misaki 0.9.4's dictionaries; load_misaki(dir)
loads another copy.
The wheel (about 5 MB) carries the data of every language except British English. British
English and the Kokoro English data are language packs: downloaded from the GitHub release of the
same version the first time they are needed, checked against SHA-256 sums inside the wheel, and
cached in ~/.cache/uccharan. On an offline machine put the .ucd files (from the release page)
in a directory named by UCCHARAN_DATA_DIR, set UCCHARAN_OFFLINE=1 to forbid downloads, or call
uccharan.load_pack(path). The transliteration packs (xlit-hi, …) and the Wiktionary packs
(wikipron-en-us, …) are CC BY-SA 4.0 and are fetched only when you call load_pack with their
name.
Documentation, measured agreement, speed and end-to-end results: https://github.com/cB-Sigma/uccharan.
Licence
Licence: Apache-2.0. Includes data from the CMU Pronouncing Dictionary (BSD-2-Clause) and misaki (Apache-2.0); see NOTICE.
The optional wikipron-* and xlit-* packs are CC BY-SA 4.0; they are separate downloads and are not part of this package.
Metadata
Release files for uccharan 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| uccharan-0.4.0.tar.gz | 8.8 MB | Without provenance | Details for uccharan-0.4.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| uccharan-0.4.0-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details for uccharan-0.4.0-cp39-abi3-win_amd64.whl |
| uccharan-0.4.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details for uccharan-0.4.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| uccharan-0.4.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details for uccharan-0.4.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
| uccharan-0.4.0-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details for uccharan-0.4.0-cp39-abi3-macosx_11_0_arm64.whl |
| uccharan-0.4.0-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details for uccharan-0.4.0-cp39-abi3-macosx_10_12_x86_64.whl |
Total release size: 35.5 MB
Release files / uccharan-0.4.0.tar.gz
| Download URL | uccharan-0.4.0.tar.gz |
|---|---|
| Size | 8.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
339cc246991893845e261297161eb67911265848b8e1e1e36a0af7527f29f718
|
|
BLAKE2b-256 checksum How to use checksums |
b486a2dbfca73c6c427b67c669b075d7cc2acd88a691b049fd5fcbe86aa4f7d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / uccharan-0.4.0-cp39-abi3-win_amd64.whl
| Download URL | uccharan-0.4.0-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
95e1b9ea35de1932b70414c7dd50fc36d9c2e689287d6e887ca5c0e47189d4ca
|
|
BLAKE2b-256 checksum How to use checksums |
ba93ed9205f13ca41daad851b1a26d2cfd7327a0729c0c6a44f817db69850b3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / uccharan-0.4.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | uccharan-0.4.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 5.4 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
f3cc0d1c7876d5ccc2e22d8bbc028875428a49e7a79f64073a90c84f8b197520
|
|
BLAKE2b-256 checksum How to use checksums |
7b5d817e6e0e48b4a4f326c0ccc803829f8b376358e3f58e5c33c25ec75716d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / uccharan-0.4.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | uccharan-0.4.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
f2f6f2e5982017450aed953828b266f570139739a16cdba878852f7376403adb
|
|
BLAKE2b-256 checksum How to use checksums |
f246166c873e101df0928847789fe6c590449966e6535762eaf922010aa24cbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / uccharan-0.4.0-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | uccharan-0.4.0-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
71b7e1aea277bf7e732ff8660d314e40d73c2007ea7f76ce5ef25eb5bef94810
|
|
BLAKE2b-256 checksum How to use checksums |
36d521584abc031575015f5343072b9a2649fef5bbc764c447869f1d79457c81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / uccharan-0.4.0-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | uccharan-0.4.0-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 5.4 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
7d1d9642abaedabffe3c624ddb7dc41e4d1477bc0d0ba05007db77cd6c012683
|
|
BLAKE2b-256 checksum How to use checksums |
4b6931b819d2e6d6fe281b7c2479c4a09570a6cc1364f6d1b5c5d455abe90384
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for uccharan 0.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.