Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Verbalis

Verbalis rewrites text the way it is read aloud, for text-to-speech front ends:

Dnia 12.03.2025 kupiłem 3 bilety.
→ Dnia dwunastego marca dwa tysiące dwudziestego piątego kupiłem trzy bilety.

Numbers, dates, times, phone numbers, money, units, symbols, abbreviations, and web addresses become words. Languages: German, English (US, GB), Spanish, French, Hindi, Italian, Polish, Portuguese, and Chinese.

C++

#include <verbalis/verbalizer.h>

verbalis::Verbalizer english("en-us");
english.process("I bought 3 tickets for $49.");  // "I bought three tickets for forty-nine dollars."

// Turn steps off, or add readings of your own
verbalis::Verbalizer custom("en-us", {.numbers = false, .abbreviations = {{"approx.", "approximately"}}});

// Map the output back to the input: each change of [start, end), counted in code points
verbalis::Result result = english.process_with_changes("5 apples & pears");

Add it to a CMake project:

add_subdirectory(verbalis/cpp)   # or FetchContent
target_link_libraries(your_target PRIVATE verbalis::verbalis)

Python

pip install verbalis   # not yet published; to build from a checkout: pip install .
from verbalis import Options, Verbalizer

english = Verbalizer("en-us")
english.process("I bought 3 tickets for $49.")  # "I bought three tickets for forty-nine dollars."

# Turn steps off, or add readings of your own
custom = Verbalizer("en-us", Options(numbers=False, abbreviations={"approx.": "approximately"}))

# Map the output back to the input: offsets count code points, so they index Python strings
text = "5 apples & pears"
for change in english.process_with_changes(text).changes:
    print(text[change.start : change.end], "->", change.replacement)

Verbalizer("xx") raises ValueError for an unsupported language; Verbalizer.languages() lists the supported codes. A Verbalizer is immutable and releases the GIL while it works, so threads can share one instance.

A TypeScript package with the same API is in progress.

Development

cmake -S cpp -B cpp/build -DVERBALIS_BUILD_TESTS=ON && cmake --build cpp/build -j
ctest --test-dir cpp/build --output-on-failure

uv venv && uv pip install ".[test]" && .venv/bin/pytest   # Python: build the extension, run tests/python

The parity tests check the C++ and Python output against tests/parity/baseline/, which every implementation must match.

License

MIT. Verbalis is extracted from the text preprocessor of Phonemis. Third-party notices are in THIRD_PARTY_NOTICES.md.

Metadata

Release files for verbalis 0.1.0a1

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

Source distribution (sdist)

Source distribution for verbalis 0.1.0a1
File Size Uploaded Provenance Actions
verbalis-0.1.0a1.tar.gz 108.0 kB Without provenance Details for verbalis-0.1.0a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for verbalis 0.1.0a1
File Interpreter ABI Platform Actions
verbalis-0.1.0a1-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for verbalis-0.1.0a1-cp312-abi3-macosx_11_0_arm64.whl

Total release size: 630.2 kB

Release files / verbalis-0.1.0a1.tar.gz

Download URL verbalis-0.1.0a1.tar.gz
Size 108.0 kB
Tags Source
SHA-256 checksum
How to use checksums
26906cc03f3f69fa5e8634f07114cef821ef0e3598b0b8e339f64f8c5197af0e
BLAKE2b-256 checksum
How to use checksums
326d5a1b344c7da3a059bc553d8eaca84f6af6277be4bf2bf3b738b5e6048486
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release files / verbalis-0.1.0a1-cp312-abi3-macosx_11_0_arm64.whl

Download URL verbalis-0.1.0a1-cp312-abi3-macosx_11_0_arm64.whl
Size 522.2 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1bbe967e6e51d1493cb374dfcebeb8a92fa2e4e61ffc75c6c20ce4d46f6ced4f
BLAKE2b-256 checksum
How to use checksums
712b93005fb1964e8cda3f6da51761174b1908e2521ef3f89fce67fb01798679
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Security for verbalis 0.1.0a1

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.

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