Skip to main content

ttsready

ttsready is a source-neutral Python library for preparing caller-owned text for speech. It accepts text units with explicit language and returns spoken text, exact source-relative changes, issues, context, statistics, and reproducibility fingerprints.

The library does not read or write files, parse SSMD or other formats, expose a CLI, generate audio, or own a document workflow. Callers adapt their source format to TextUnit values and decide what to do with the returned data.

Install

Python 3.10 or newer is required.

python -m pip install ttsready

The runtime dependencies are spokenform>=0.4.5,<1 and phrasplit>=0.3.9,<1. Install the optional lexical extra when you need its lexical-evidence integrations:

python -m pip install 'ttsready[lexical]'

Quickstart

from ttsready import prepare_text

prepared = prepare_text("A young reader opened a book.", language="en-US")
print(prepared.spoken_text)

for change in prepared.changes:
    print(change.source, "→", change.replacement, change.source_start, change.source_end)

prepare_text() prepares one unit and returns a PreparedUnit. Use prepare_units() when you have multiple caller-owned units, possibly with different languages, roles, protected spans, or metadata. See docs/quickstart.md and the runnable API example.

Core contract

  • Inputs are immutable TextUnit records with caller-chosen IDs, text, explicit language, optional role, protected spans, and JSON-safe metadata.
  • SpeechOverride values express global, unit-scoped, or exact-occurrence pronunciation policy.
  • Results expose exact half-open source and output spans, stable IDs, warnings and residual QA issues, sentence context, and aggregate statistics.
  • JSON serialization and fingerprints are pure; persistence and storage are caller responsibilities.
from ttsready import TextUnit, prepare_units

result = prepare_units(
    (
        TextUnit("chapter-1", "2 kg", "en-US", role="body"),
        TextUnit("caption-1", "Bonjour.", "fr-FR", role="caption"),
    )
)

for unit in result.units:
    print(unit.unit_id, unit.spoken_text)

Documentation

Migrating from 0.1.x

Version 0.2 is a breaking, API-only release. SSMD/document APIs, the CLI, file and cache I/O, writers, planning, speaker/JEV workflows, and their application-owned models were removed. Convert or read source data in your application, pass text units to prepare_text() or prepare_units(), then persist or render results in your application. See the migration guide.

License

ttsready is licensed under the Apache License 2.0. See LICENSE for the full text.

Metadata

Release files for ttsready 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 ttsready 0.2.0
File Size Uploaded
ttsready-0.2.0.tar.gz 37.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ttsready 0.2.0
File Interpreter ABI Platform
ttsready-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 65.6 kB

Release files / ttsready-0.2.0.tar.gz

Download URL ttsready-0.2.0.tar.gz
Size 37.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a555cd7c0dd8eb6fb52e4773322f822cad5a60f85218e624b2518e352148c874
BLAKE2b-256 checksum
How to use checksums
2552a113138ea86a5f76d57cef31779cc7ed9e0ea38665c8fd9d4bb0dfbc00d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Release files / ttsready-0.2.0-py3-none-any.whl

Download URL ttsready-0.2.0-py3-none-any.whl
Size 28.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fbfffba0dde92f72fcfdef39512ab0f9f97cdb8c5ca520e15494a707b730ea7c
BLAKE2b-256 checksum
How to use checksums
23ed3e04beb078dedf83c890b1dedccd167913fefc403950bd224eaef8cb9b25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.2.3

2 release files

This release

0.2.0 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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