This release is a pre-release and may not be stable for production use.
text2spoken
text2spoken rewrites written text into the words that a person says when they read it aloud. It reads numbers, dates, times, money, measures, percentages, telephone numbers, colours, abbreviations, and e-mail and web addresses. The rest of the text stays as it is, character for character.
Install
uv pip install --prerelease=allow text2spoken
It needs Python 3.11 or later, and uses no network and no model. Every language reads with the base install. Portuguese takes the pt extra for the gender of nouns and names, from tugalex.
Example
>>> from text2spoken import normalize
>>> normalize("Dr Smith paid £3.50 for 2 tickets on 14 March 2024.", "en-GB")
'Doctor Smith paid three pounds and fifty pence for two tickets on the fourteenth of March twenty twenty-four.'
>>> normalize("Meet on 03/04/2025 at 7:30 pm.", "en-US")
'Meet on March fourth twenty twenty-five at seven thirty PM.'
>>> normalize("O Dr. Silva pagou 2,50 € às 14:30.", "pt-PT")
'O Doutor Silva pagou dois euros e cinquenta cêntimos às catorze e trinta.'
The second argument is a BCP 47 tag. It selects the language and the variety.
Find your answer
| You want to | Read |
|---|---|
| Install it and make a first call | Quickstart |
| Turn a form off or on, or add your own words | Usage |
Read a form that SSML say-as markup names |
API, say_as |
| Know why a text reads as it does | How it reads text |
| Add your language, step by step | Adding a language |
| Look up a function, a param or an error | API, Errors and warnings |
| Know when the output of a language can change | API, revision |
| Run the tests | Development |
The docs index lists every page.
Languages
A tag with no language file reads cardinal numbers, decimals and a minus from the CLDR spell-out rules, in the decimal and group marks of CLDR for the locale.
| Language | Varieties | Extra |
|---|---|---|
| Arabic | ar-001, ten regional tags, and 25 ISO 639-3 varieties such as arz |
ar |
| Catalan | ca-ES, ca-AD, ca-ES-valencia |
ca |
| German | de-DE, de-AT, de-CH |
none |
| Greek | el-GR |
none |
| English | en-GB, en-US |
none |
| Spanish | es-ES, es-419 and eleven American varieties |
es |
| Basque | eu-ES |
eu |
| French | fr-FR, fr-CA, fr-CH. Every other fr-* tag reads as fr-FR |
fr |
| Italian | it-IT, it-CH, it-SM |
it |
| Japanese | ja-JP |
none |
| Korean | ko-KR |
none |
| Dutch | nl-NL, nl-BE, nl-SR |
nl |
| Portuguese | pt-PT, pt-BR |
pt |
| Russian | ru-RU |
ru |
| Chinese | zh-CN, zh-TW, and cmn |
none |
Where this fits
text2spoken is the normalisation stage: a voice, a phonemizer or a word error rate score calls normalize first. scriptconv uses it through an extra: uv pip install --prerelease=allow "scriptconv[normalize]".
Licence
Apache-2.0, in LICENSE. The CLDR data in text2spoken/data/cldr/ ships under the Unicode License v3. CHANGELOG.md lists the changes of each release.
Metadata
Release files for text2spoken 0.0.2a90
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 |
|---|---|---|---|---|
| text2spoken-0.0.2a90.tar.gz | 2.3 MB | Without provenance | Details for text2spoken-0.0.2a90.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| text2spoken-0.0.2a90-py3-none-any.whl | Python 3 | none | any | Details for text2spoken-0.0.2a90-py3-none-any.whl |
Total release size: 4.5 MB
Release files / text2spoken-0.0.2a90.tar.gz
| Download URL | text2spoken-0.0.2a90.tar.gz |
|---|---|
| Size | 2.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
472bf140bd3efb78014e92bb1f85fbaa7bff4aca5842ffa6959e2d75361e72ac
|
|
BLAKE2b-256 checksum How to use checksums |
27d0434f07c5178ca36770e23a88c92bf0664f16b9c437978ceed49f6a7580dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / text2spoken-0.0.2a90-py3-none-any.whl
| Download URL | text2spoken-0.0.2a90-py3-none-any.whl |
|---|---|
| Size | 2.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
193f63e9a4bc0af92e406820090fd1cf95ee513d63697c398c6014485142c916
|
|
BLAKE2b-256 checksum How to use checksums |
8cb4f80b02eda9bf69c4c613cf689502c207ce0f9651ed45851074738106c95e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for text2spoken 0.0.2a90
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.