Skip to content

Commit 2201dae

Browse files
committed
pypi package
1 parent a807a24 commit 2201dae

File tree

4 files changed

+230
-4
lines changed

4 files changed

+230
-4
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
test_pypi:
9+
description: 'Publish to Test PyPI instead of PyPI'
10+
required: false
11+
default: false
12+
type: boolean
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Install build dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install build twine
29+
30+
- name: Build package
31+
run: python -m build
32+
33+
- name: Check package
34+
run: twine check dist/*
35+
36+
- name: Upload build artifacts
37+
uses: actions/upload-artifact@v3
38+
with:
39+
name: dist
40+
path: dist/
41+
42+
publish:
43+
needs: build
44+
runs-on: ubuntu-latest
45+
environment:
46+
name: ${{ github.event.inputs.test_pypi == 'true' && 'test-pypi' || 'pypi' }}
47+
url: ${{ github.event.inputs.test_pypi == 'true' && 'https://test.pypi.org/p/ttsfm' || 'https://pypi.org/p/ttsfm' }}
48+
permissions:
49+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
50+
51+
steps:
52+
- name: Download build artifacts
53+
uses: actions/download-artifact@v3
54+
with:
55+
name: dist
56+
path: dist/
57+
58+
- name: Publish to Test PyPI
59+
if: github.event.inputs.test_pypi == 'true'
60+
uses: pypa/gh-action-pypi-publish@release/v1
61+
with:
62+
repository-url: https://test.pypi.org/legacy/
63+
verbose: true
64+
65+
- name: Publish to PyPI
66+
if: github.event.inputs.test_pypi != 'true'
67+
uses: pypa/gh-action-pypi-publish@release/v1
68+
with:
69+
verbose: true

CHANGELOG.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [3.0.0] - 2025-06-06
9+
10+
### 🎉 First Python Package Release
11+
12+
This is the first release of TTSFM as an installable Python package. Previous versions (v1.x and v2.x) were service-only releases that provided the API server but not a pip-installable package.
13+
14+
### ✨ Added
15+
16+
- **Complete Package Restructure**: Modern Python package structure with proper typing
17+
- **Async Support**: Full asynchronous client implementation with `asyncio`
18+
- **OpenAI API Compatibility**: Drop-in replacement for OpenAI TTS API
19+
- **Type Hints**: Complete type annotation support throughout the codebase
20+
- **CLI Interface**: Command-line tool for easy TTS generation
21+
- **Web Application**: Optional Flask-based web interface
22+
- **Docker Support**: Multi-architecture Docker images (linux/amd64, linux/arm64)
23+
- **Comprehensive Error Handling**: Detailed exception hierarchy
24+
- **Multiple Audio Formats**: Support for MP3, WAV, FLAC, and more
25+
- **Voice Options**: Multiple voice models (alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer)
26+
- **Text Processing**: Automatic text length validation and splitting
27+
- **Rate Limiting**: Built-in rate limiting and retry mechanisms
28+
- **Configuration**: Environment variable and configuration file support
29+
30+
### 🔧 Technical Improvements
31+
32+
- **Modern Build System**: Using `pyproject.toml` with setuptools
33+
- **GitHub Actions**: Automated Docker builds and PyPI publishing
34+
- **Development Tools**: Pre-commit hooks, linting, testing setup
35+
- **Documentation**: Comprehensive README and inline documentation
36+
- **Package Management**: Proper dependency management with optional extras
37+
38+
### 🌐 API Changes
39+
40+
- **Breaking**: Complete API redesign for better usability
41+
- **OpenAI Compatible**: `/v1/audio/speech` endpoint compatibility
42+
- **RESTful Design**: Clean REST API design
43+
- **Health Checks**: Built-in health check endpoints
44+
- **CORS Support**: Cross-origin resource sharing enabled
45+
46+
### 📦 Installation Options
47+
48+
```bash
49+
# Basic installation
50+
pip install ttsfm
51+
52+
# With web application support
53+
pip install ttsfm[web]
54+
55+
# With development tools
56+
pip install ttsfm[dev]
57+
58+
# Docker
59+
docker run -p 8000:8000 ghcr.io/dbccccccc/ttsfm:latest
60+
```
61+
62+
### 🚀 Quick Start
63+
64+
```python
65+
from ttsfm import TTSClient, Voice
66+
67+
client = TTSClient()
68+
response = client.generate_speech(
69+
text="Hello! This is TTSFM v3.0.0",
70+
voice=Voice.CORAL
71+
)
72+
73+
with open("speech.mp3", "wb") as f:
74+
f.write(response.audio_data)
75+
```
76+
77+
### 📦 Package vs Service History
78+
79+
**Important Note**: This v3.0.0 is the first release of TTSFM as a Python package available on PyPI. Previous versions (v1.x and v2.x) were service/API server releases only and were not available as installable packages.
80+
81+
- **v1.x - v2.x**: Service releases (API server only, not pip-installable)
82+
- **v3.0.0+**: Full Python package releases (pip-installable with service capabilities)
83+
84+
### 🐛 Bug Fixes
85+
86+
- Fixed Docker build issues with dependency resolution
87+
- Improved error handling and user feedback
88+
- Better handling of long text inputs
89+
- Enhanced stability and performance
90+
91+
### 📚 Documentation
92+
93+
- Complete API documentation
94+
- Usage examples and tutorials
95+
- Docker deployment guide
96+
- Development setup instructions
97+
98+
---
99+
100+
## Previous Service Releases (Not Available as Python Packages)
101+
102+
The following versions were service/API server releases only and were not available as pip-installable packages:
103+
104+
### [2.0.0-alpha9] - 2025-04-09
105+
- Service improvements (alpha release)
106+
107+
### [2.0.0-alpha8] - 2025-04-09
108+
- Service improvements (alpha release)
109+
110+
### [2.0.0-alpha7] - 2025-04-07
111+
- Service improvements (alpha release)
112+
113+
### [2.0.0-alpha6] - 2025-04-07
114+
- Service improvements (alpha release)
115+
116+
### [2.0.0-alpha5] - 2025-04-07
117+
- Service improvements (alpha release)
118+
119+
### [2.0.0-alpha4] - 2025-04-07
120+
- Service improvements (alpha release)
121+
122+
### [2.0.0-alpha3] - 2025-04-07
123+
- Service improvements (alpha release)
124+
125+
### [2.0.0-alpha2] - 2025-04-07
126+
- Service improvements (alpha release)
127+
128+
### [2.0.0-alpha1] - 2025-04-07
129+
- Alpha release (DO NOT USE)
130+
131+
### [1.3.0] - 2025-03-28
132+
- Support for additional audio file formats in the API
133+
- Alignment with formats supported by the official API
134+
135+
### [1.2.2] - 2025-03-28
136+
- Fixed Docker support
137+
138+
### [1.2.1] - 2025-03-28
139+
- Color change for indicator for status
140+
- Voice preview on webpage for each voice
141+
142+
### [1.2.0] - 2025-03-26
143+
- Enhanced stability and availability by implementing advanced request handling mechanisms
144+
- Removed the proxy pool
145+
146+
### [1.1.2] - 2025-03-26
147+
- Version display on webpage
148+
- Last version of 1.1.x
149+
150+
### [1.1.1] - 2025-03-26
151+
- Build fixes
152+
153+
### [1.1.0] - 2025-03-26
154+
- Project restructuring for better future development experiences
155+
- Added .env settings
156+
157+
### [1.0.0] - 2025-03-26
158+
- First service release

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "ttsfm"
77
version = "3.0.0"
88
description = "Text-to-Speech API Client with OpenAI compatibility"
99
readme = "README.md"
10-
license = {file = "LICENSE"}
10+
license = "MIT"
1111
authors = [
1212
{name = "TTSFM Team", email = "[email protected]"}
1313
]
@@ -17,7 +17,7 @@ maintainers = [
1717
classifiers = [
1818
"Development Status :: 4 - Beta",
1919
"Intended Audience :: Developers",
20-
"License :: OSI Approved :: MIT License",
20+
2121
"Operating System :: OS Independent",
2222
"Programming Language :: Python :: 3",
2323
"Programming Language :: Python :: 3.8",

ttsfm-web/requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ python-dotenv>=1.0.0
66

77
# TTSFM package (install from local directory or PyPI)
88
# For local development: pip install -e ../
9-
# For production: pip install ttsfm>=3.0.0
10-
ttsfm>=3.0.0
9+
# For Docker/production: installed via pyproject.toml[web] dependencies

0 commit comments

Comments
 (0)