Metadata-Version: 2.4
Name: ttsforge
Version: 0.5.2
Summary: User-friendly audiobook conversion powered by Readio.
Author-email: Holger Nahrstaedt <nahrstaedt@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Holger Nahrstaedt
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/buchwandler/ttsforge
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: readio[audioexport]<0.7,>=0.6.9
Requires-Dist: rich>=13.0.0
Requires-Dist: typer>=0.20.0
Requires-Dist: tomli>=2; python_version < "3.11"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.8.0; extra == "dev"
Provides-Extra: server
Requires-Dist: fastapi<1,>=0.115; extra == "server"
Requires-Dist: pydantic<3,>=2.9; extra == "server"
Requires-Dist: uvicorn<1,>=0.32; extra == "server"
Requires-Dist: python-multipart<1,>=0.0.20; extra == "server"
Provides-Extra: studio
Requires-Dist: fastapi<1,>=0.115; extra == "studio"
Requires-Dist: pydantic<3,>=2.9; extra == "studio"
Requires-Dist: uvicorn<1,>=0.32; extra == "studio"
Requires-Dist: python-multipart<1,>=0.0.20; extra == "studio"
Requires-Dist: readio[spacy]<0.7,>=0.6.9; extra == "studio"
Dynamic: license-file

[![PyPI - Version](https://img.shields.io/pypi/v/ttsforge)](https://pypi.org/project/ttsforge/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ttsforge)
![PyPI - Downloads](https://img.shields.io/pypi/dm/ttsforge)
[![codecov](https://codecov.io/gh/buchwandler/ttsforge/graph/badge.svg?token=iCHXwbjAXG)](https://codecov.io/gh/buchwandler/ttsforge)

# TTSForge

**TTSForge is an audiobook-oriented command-line frontend for Readio.** It turns EPUBs
into M4B audiobooks while Readio owns workflow planning, synthesis, composition,
progress, and export.

TTSForge requires `readio>=0.6.9,<0.7`. Its base dependencies are provider-neutral.
Install and configure a Readio engine integration separately when you want to synthesize
speech; use Readio's installation documentation for the integrations supported by your
platform.

## What it does

- Inspect EPUB metadata and chapters without creating a project.
- Guide audiobook setup and persist it for retries.
- Render and export an M4B through Readio's public workflow API.
- Inspect workflow status and discover Readio engines, targets, and voices.
- Keep existing TTSForge/Readio 0.4 project data untouched instead of attempting an
  automatic migration.

## Quick start

Install TTSForge, then inspect and convert a book:

```bash
python -m pip install ttsforge
ttsforge list novel.epub
ttsforge convert novel.epub
```

In an interactive terminal, conversion guides you through missing chapter and voice
setup, shows a read-only preflight, then asks before rendering. Setup is saved before
rendering, so a failed attempt can be retried with the saved choices.

For automation, specify the chapter selection and any setup values you want to pin:

```bash
ttsforge convert novel.epub --chapters 1-5 --engine ENGINE --target TARGET --voice VOICE --non-interactive
```

`--json` is also prompt-free. See [Quick start](docs/quickstart.md) and the
[CLI reference](docs/cli.md) for details.

## Projects and output

For `novel.epub`, the default project is `novel.ttsforge/` beside the source, and the
default output is `novel.m4b`. The project contains Readio's saved render intent and
narrator profile plus the persistent `book.ssmd-bundle/` workspace. Use `--project` to
choose another location or `--fresh` to start in a separate project directory. See
[Projects and outputs](docs/projects.md).

Output replacement and stage rebuild are separate explicit controls: use
`--replace-output` to authorize replacing an existing M4B, and `--rebuild-from STAGE` to
ask Readio to rebuild from a selected workflow stage.

To use a different synthesis setup while keeping the project's prepared book state, run
`ttsforge convert novel.epub --new-variant`. TTSForge stores the alternate Readio setup
under `variants/<configuration-key>/` and writes a separately named M4B. It reuses the
project's SSMD bundle and leaves the base setup and output untouched. Use
`ttsforge info` to inspect alternate setups.

## Discover engines and voices

```bash
ttsforge engines
ttsforge targets --engine ENGINE --language en-us
ttsforge voices --engine ENGINE --target TARGET --language en-us
```

Catalog contents and runtime availability depend on installed Readio integrations and
local configuration.

## Migration from TTSForge 0.4

TTSForge 0.5 uses Readio's 0.6.1 workflow-gateway API and a new `.ttsforge/` project
layout. Existing TTSForge or Readio 0.4 workspaces cannot be resumed by this version.
They are rejected without automatic migration or mutation. Keep them as-is and start a
separate project with `--fresh` or an explicit new `--project` path. See the
[migration guide](docs/migration-readio.md).

The former backend-specific commands and configuration interface are not part of the
audiobook CLI. TTSForge's supported interface is the command line; Python integrations
should use Readio's public `readio.api` directly. See the
[API boundary](docs/api/index.md).

## Documentation

- [Installation](docs/installation.md)
- [Quick start](docs/quickstart.md)
- [CLI reference](docs/cli.md)
- [Project lifecycle](docs/projects.md)
- [Saved setup](docs/configuration.md)
- [Engine and voice discovery](docs/voices.md)
- [Migration guide](docs/migration-readio.md)
- [Python API boundary](docs/api/index.md)
- [Examples](examples/README.md)
