--- id: gtts version: "2.5.4" license: MIT license_treatment: permissive maintenance: active --- # gTTS — gTTS (Google Text-to-Speech), a Python library and CLI tool to interface with Google Translate text-to-speech API License: permissive · Maintenance: active · Downloads: 5.3M/mo ## What it is and what it does gTTS is a Python wrapper around Google Translate's undocumented text-to-speech functionality. It lets you generate MP3 audio from text strings and save them to disk, pass them to other audio libraries, or stream to stdout. The library includes a customizable sentence tokenizer to handle long texts while preserving intonation, abbreviations, and decimals, and supports custom text pre-processors for pronunciation corrections. You can use it as a Python module or via a command-line tool (gtts-cli). It supports modern Python versions (3.8–3.12) across macOS, Windows, and Linux. The project is not affiliated with Google and relies on an undocumented API, so breaking changes can occur without notice—it is explicitly different from the official Google Cloud Text-to-Speech service. Use it for: - Generate spoken audio files from text for accessibility or content creation workflows. - Build a command-line tool to batch-convert text documents or scripts into MP3 files. - Integrate text-to-speech into a Python application without setting up a paid cloud service. - Preprocess and customize pronunciation in generated speech using text pre-processors. - Stream audio output directly to stdout for piping into other audio processing tools. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. gTTS converts text to speech using Google Translate's API, writing MP3 audio to files, file-like objects, or stdout via Python library or command-line tool. Yes, if you need lightweight, free text-to-speech without cloud setup. The low install friction, active maintenance, and MIT license make it straightforward to adopt. However, be aware that it depends on Google Translate's undocumented API—upstream changes can break it without notice, and it is not a substitute for official Google Cloud Text-to-Speech if you need production-grade reliability or SLA guarantees. ## Install pip install gtts uv add gtts poetry add gtts ## Installing gTTS Before you install: Low install friction with only two runtime dependencies (requests, click). Actively maintained with recent commits and a large user base; last release was 642 days ago but repo shows ongoing activity. License in practice: MIT license is permissive, allowing commercial and private use with minimal restrictions—suitable for most projects. Quickstart: pip install gTTS from gtts import gTTS tts = gTTS('hello') tts.save('hello.mp3') Requires internet access to reach Google Translate's API; relies on that undocumented endpoint remaining available. Verify before relying: - Whether Google Translate API changes could break the package without notice, as the description disclaims. - Performance characteristics when handling very long texts or batch conversions. - Audio quality or language support coverage compared to official Google Cloud Text-to-Speech. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 5.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags text to speech python, google translate tts, mp3 audio generation, gtts cli tool, convert text to audio, speech synthesis google, tts library python, text-to-speech, audio-generation, cli-tool [View on SkillFed](https://skillfed.io/packages/gtts) · [View on PyPI](https://pypi.org/project/gtts/)