Skip to main content

pyt2s

The Python Text-to-Speech library you didn’t know you needed (or maybe you did).

⚠️ Toy project alert: This is experimental and fun, not production-grade.

Downloads

🎯 What is pyt2s

A lightweight Python wrapper for generating speech from text using various online TTS services—no heavy model downloads, no complex setup. Just plug, play, and talk.

Inspired by Chris Phillips's php tts library library, pyt2s was born out of frustration:

“Why is there no Python TTS library that’s simple, supports multiple voices (including both genders), and doesn’t ask me to download 20GB of models?”

Now there is.

🧠 Supported TTS Service

pyt2s taps into several online services to give you voice variety:

  • Acapela
  • Cepstral
  • Oddcast
  • Stream Elements
  • Stream Labs
  • Voice Forge

🚀 Installation

Option 1: From Source

git clone https://github.com/yourusername/pyt2s.git
cd pyt2s
pip install -r requirements.txt
pip install -e .

Option 2: From PyPI

pip install pyt2s

🛠️ Usage

Here’s how to convert text to speech and save it as an MP3:

from pyt2s.services import stream_elements

# Default Voice
data = stream_elements.requestTTS('Lorem Ipsum is simply dummy text.')

# Custom Voice
data = stream_elements.requestTTS('Lorem Ipsum is simply dummy text.', stream_elements.Voice.Russell)

with open('output.mp3', '+wb') as file:
    file.write(data)

Metadata

Release files for pyt2s 0.0.6

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

Source distribution (sdist)

Source distribution for pyt2s 0.0.6
File Size Uploaded Provenance Actions
pyt2s-0.0.6.tar.gz 13.2 kB Without provenance Details for pyt2s-0.0.6.tar.gz

Built distribution (wheel)

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

Total release size: 28.5 kB

Release files / pyt2s-0.0.6.tar.gz

Download URL pyt2s-0.0.6.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f0540aec1c533804240b8536d95b6dc12933f431915a337e3e44f497938775ed
BLAKE2b-256 checksum
How to use checksums
670d2fdf60145bb4f11fc74a33bff28b2b309d5e08bb7b1b3ce92103e516e003
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.14.2

Release files / pyt2s-0.0.6-py3-none-any.whl

Download URL pyt2s-0.0.6-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51c586cd5ffbc800d2cfb7057532627a9eae79396abd7fbff6261d448d36840e
BLAKE2b-256 checksum
How to use checksums
3412452b65d928aa818e5623d7ef4fc44e5b6a2c2abe2e051d50c2a10259b255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.14.2

Security for pyt2s 0.0.6

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