Skip to main content
Pre-release

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. It uses no network and no model.

Quickstart

uv pip install --prerelease=allow text2spoken
>>> 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 file and the variety. The library needs Python 3.11 or later. Every language reads with the base install. Portuguese takes the pt extra for the gender of nouns and names, from tugalex.

Where this fits

Alone: rewrite one string for one language tag with from text2spoken import normalize. In the stack: the normalisation stage before a phonemizer or a voice. The phonemizers tugaphone and euskaphone, the voice library phoonnx and the scriptconv TextFrontend call normalize(text, lang). It calls ovos-number-parser, ovos-date-parser, unicode-rbnf, linguatag and quebra-frases. Through scriptconv: uv pip install --prerelease=allow "scriptconv[normalize]".

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 in reading order. A contributor reads AGENTS.md for the map of the repository and the rules that a pull request must meet.

Languages

Each language page gives what the language reads, its varieties, its options, its sources and its limits. supports(lang) gives the same facts from code.

Language Varieties
Arabic ar-001, the regional ar-* tags, and the spoken lects of ISO 639-3, such as arz
Catalan ca-ES, ca-AD, ca-ES-valencia
German de-DE, de-AT, de-CH
Greek el-GR
English en-GB, en-US
Spanish es-ES, es-419 and the American varieties, such as es-MX
Basque eu-ES
French fr-FR, fr-CA, fr-CH, and each other fr-* tag with the number words of its CLDR locale
Italian it-IT, it-CH, it-SM
Japanese ja-JP
Korean ko-KR
Dutch nl-NL, nl-BE, nl-SR
Portuguese pt-PT, pt-BR
Russian ru-RU
Tetun Dili tdt-TL
Chinese zh-CN, zh-TW, and cmn

A tag with no language file reads cardinal numbers, decimals and a minus, with the words of ovos-number-parser or of the CLDR spell-out rules, in the decimal and group marks of CLDR for the locale. The page How it reads text gives the rules.

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.2a112

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for text2spoken 0.0.2a112
File Size Uploaded Provenance Actions
text2spoken-0.0.2a112.tar.gz 2.3 MB Without provenance Details for text2spoken-0.0.2a112.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for text2spoken 0.0.2a112
File Interpreter ABI Platform Actions
text2spoken-0.0.2a112-py3-none-any.whl Python 3 none any Details for text2spoken-0.0.2a112-py3-none-any.whl

Total release size: 4.6 MB

Release files / text2spoken-0.0.2a112.tar.gz

Download URL text2spoken-0.0.2a112.tar.gz
Size 2.3 MB
Tags Source
SHA-256 checksum
How to use checksums
d8f218cf0a7c1c4995f3f8123ed58a4b39bb845a5d848034b34154f725797737
BLAKE2b-256 checksum
How to use checksums
22c313555a85b705e266c26801c2ba7ea609c9c48ed99ea3e447fe959270be2b
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.2a112-py3-none-any.whl

Download URL text2spoken-0.0.2a112-py3-none-any.whl
Size 2.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
dc16ae8df24d8e5a39faaaa2103fe762e86d089ef548e81fe3a2734aa82ee91b
BLAKE2b-256 checksum
How to use checksums
22dca4ca980a6e2a687ea875e8d8ef39aa61a3b0e0e2874e6c9f12f538b5ef0d
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.2a112

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.

Release history Release notifications | RSS feed

This release
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