typecast-python 0.1.5__tar.gz → 0.1.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- typecast_python-0.1.7/.gitignore +319 -0
- {typecast_python-0.1.5 → typecast_python-0.1.7}/PKG-INFO +4 -4
- {typecast_python-0.1.5 → typecast_python-0.1.7}/README.md +1 -1
- {typecast_python-0.1.5 → typecast_python-0.1.7}/pyproject.toml +6 -3
- {typecast_python-0.1.5 → typecast_python-0.1.7}/src/typecast/models/tts.py +26 -2
- typecast_python-0.1.5/.gitignore +0 -57
- {typecast_python-0.1.5 → typecast_python-0.1.7}/LICENSE +0 -0
- {typecast_python-0.1.5 → typecast_python-0.1.7}/src/typecast/__init__.py +0 -0
- {typecast_python-0.1.5 → typecast_python-0.1.7}/src/typecast/async_client.py +0 -0
- {typecast_python-0.1.5 → typecast_python-0.1.7}/src/typecast/client.py +0 -0
- {typecast_python-0.1.5 → typecast_python-0.1.7}/src/typecast/conf.py +0 -0
- {typecast_python-0.1.5 → typecast_python-0.1.7}/src/typecast/exceptions.py +0 -0
- {typecast_python-0.1.5 → typecast_python-0.1.7}/src/typecast/models/__init__.py +0 -0
- {typecast_python-0.1.5 → typecast_python-0.1.7}/src/typecast/models/error.py +0 -0
- {typecast_python-0.1.5 → typecast_python-0.1.7}/src/typecast/models/tts_wss.py +0 -0
- {typecast_python-0.1.5 → typecast_python-0.1.7}/src/typecast/models/voices.py +0 -0
- {typecast_python-0.1.5 → typecast_python-0.1.7}/src/typecast/sse.py +0 -0
- {typecast_python-0.1.5 → typecast_python-0.1.7}/src/typecast/utils.py +0 -0
- {typecast_python-0.1.5 → typecast_python-0.1.7}/src/typecast/websocket.py +0 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
# ================================
|
|
2
|
+
# Typecast SDK Monorepo .gitignore
|
|
3
|
+
# ================================
|
|
4
|
+
|
|
5
|
+
# ----------------
|
|
6
|
+
# Environment
|
|
7
|
+
# ----------------
|
|
8
|
+
.env
|
|
9
|
+
.env.local
|
|
10
|
+
.env.*.local
|
|
11
|
+
*.env
|
|
12
|
+
!.env.example
|
|
13
|
+
|
|
14
|
+
# ----------------
|
|
15
|
+
# Node.js / JavaScript
|
|
16
|
+
# ----------------
|
|
17
|
+
node_modules/
|
|
18
|
+
# Note: package-lock.json is NOT ignored - required for npm ci in CI
|
|
19
|
+
yarn.lock
|
|
20
|
+
pnpm-lock.yaml
|
|
21
|
+
|
|
22
|
+
# Build outputs (JS)
|
|
23
|
+
lib/
|
|
24
|
+
dist/
|
|
25
|
+
build/
|
|
26
|
+
*.tsbuildinfo
|
|
27
|
+
|
|
28
|
+
# Test coverage
|
|
29
|
+
coverage/
|
|
30
|
+
|
|
31
|
+
# Optional npm cache
|
|
32
|
+
.npm
|
|
33
|
+
.eslintcache
|
|
34
|
+
|
|
35
|
+
# Logs (JS)
|
|
36
|
+
npm-debug.log*
|
|
37
|
+
yarn-debug.log*
|
|
38
|
+
yarn-error.log*
|
|
39
|
+
|
|
40
|
+
# ----------------
|
|
41
|
+
# Python
|
|
42
|
+
# ----------------
|
|
43
|
+
__pycache__/
|
|
44
|
+
*.py[cod]
|
|
45
|
+
*$py.class
|
|
46
|
+
*.so
|
|
47
|
+
.Python
|
|
48
|
+
develop-eggs/
|
|
49
|
+
downloads/
|
|
50
|
+
eggs/
|
|
51
|
+
.eggs/
|
|
52
|
+
lib64/
|
|
53
|
+
parts/
|
|
54
|
+
sdist/
|
|
55
|
+
var/
|
|
56
|
+
wheels/
|
|
57
|
+
*.egg-info/
|
|
58
|
+
.installed.cfg
|
|
59
|
+
*.egg
|
|
60
|
+
|
|
61
|
+
# Virtual environments
|
|
62
|
+
.venv
|
|
63
|
+
.test_venv
|
|
64
|
+
.ci_test_venv
|
|
65
|
+
env/
|
|
66
|
+
venv/
|
|
67
|
+
ENV/
|
|
68
|
+
|
|
69
|
+
# Testing (Python)
|
|
70
|
+
.coverage
|
|
71
|
+
htmlcov/
|
|
72
|
+
.pytest_cache/
|
|
73
|
+
.mypy_cache/
|
|
74
|
+
.ruff_cache/
|
|
75
|
+
|
|
76
|
+
# ----------------
|
|
77
|
+
# C / C++
|
|
78
|
+
# ----------------
|
|
79
|
+
# Build directories
|
|
80
|
+
[Bb]uild/
|
|
81
|
+
cmake-build-*/
|
|
82
|
+
CMakeFiles/
|
|
83
|
+
CMakeCache.txt
|
|
84
|
+
cmake_install.cmake
|
|
85
|
+
Makefile
|
|
86
|
+
*.cmake
|
|
87
|
+
|
|
88
|
+
# Compiled objects
|
|
89
|
+
*.o
|
|
90
|
+
*.obj
|
|
91
|
+
*.a
|
|
92
|
+
*.lib
|
|
93
|
+
|
|
94
|
+
# Executables
|
|
95
|
+
*.exe
|
|
96
|
+
*.out
|
|
97
|
+
|
|
98
|
+
# Libraries
|
|
99
|
+
*.dylib
|
|
100
|
+
|
|
101
|
+
# ----------------
|
|
102
|
+
# C# / .NET
|
|
103
|
+
# ----------------
|
|
104
|
+
[Dd]ebug/
|
|
105
|
+
[Dd]ebugPublic/
|
|
106
|
+
[Rr]elease/
|
|
107
|
+
[Rr]eleases/
|
|
108
|
+
x64/
|
|
109
|
+
x86/
|
|
110
|
+
[Ww][Ii][Nn]32/
|
|
111
|
+
[Aa][Rr][Mm]/
|
|
112
|
+
[Aa][Rr][Mm]64/
|
|
113
|
+
bld/
|
|
114
|
+
[Bb]in/
|
|
115
|
+
[Oo]bj/
|
|
116
|
+
[Ll]og/
|
|
117
|
+
[Ll]ogs/
|
|
118
|
+
|
|
119
|
+
# Visual Studio
|
|
120
|
+
.vs/
|
|
121
|
+
*.suo
|
|
122
|
+
*.user
|
|
123
|
+
*.userosscache
|
|
124
|
+
*.sln.docstates
|
|
125
|
+
|
|
126
|
+
# NuGet packages
|
|
127
|
+
*.nupkg
|
|
128
|
+
*.snupkg
|
|
129
|
+
packages/
|
|
130
|
+
*.nuget.props
|
|
131
|
+
*.nuget.targets
|
|
132
|
+
|
|
133
|
+
# Test results (.NET)
|
|
134
|
+
[Tt]est[Rr]esult*/
|
|
135
|
+
[Bb]uild[Ll]og.*
|
|
136
|
+
*.trx
|
|
137
|
+
*.coveragexml
|
|
138
|
+
coverage*.json
|
|
139
|
+
coverage*.xml
|
|
140
|
+
|
|
141
|
+
# NCrunch
|
|
142
|
+
*.ncrunchproject
|
|
143
|
+
*.ncrunchsolution
|
|
144
|
+
_NCrunch_*
|
|
145
|
+
|
|
146
|
+
# DotCover
|
|
147
|
+
*.dotCover
|
|
148
|
+
|
|
149
|
+
# BenchmarkDotNet
|
|
150
|
+
BenchmarkDotNet.Artifacts/
|
|
151
|
+
|
|
152
|
+
# Project specific
|
|
153
|
+
*.DotSettings.user
|
|
154
|
+
launchSettings.json
|
|
155
|
+
|
|
156
|
+
# ----------------
|
|
157
|
+
# Go
|
|
158
|
+
# ----------------
|
|
159
|
+
*.exe~
|
|
160
|
+
*.dll
|
|
161
|
+
*.test
|
|
162
|
+
go.work
|
|
163
|
+
go.work.sum
|
|
164
|
+
vendor/
|
|
165
|
+
test_output*
|
|
166
|
+
|
|
167
|
+
# ----------------
|
|
168
|
+
# Java
|
|
169
|
+
# ----------------
|
|
170
|
+
# Maven
|
|
171
|
+
target/
|
|
172
|
+
pom.xml.tag
|
|
173
|
+
pom.xml.releaseBackup
|
|
174
|
+
pom.xml.versionsBackup
|
|
175
|
+
pom.xml.next
|
|
176
|
+
release.properties
|
|
177
|
+
dependency-reduced-pom.xml
|
|
178
|
+
buildNumber.properties
|
|
179
|
+
.mvn/timing.properties
|
|
180
|
+
.mvn/wrapper/maven-wrapper.jar
|
|
181
|
+
|
|
182
|
+
# Compiled files
|
|
183
|
+
*.class
|
|
184
|
+
|
|
185
|
+
# Package files
|
|
186
|
+
*.jar
|
|
187
|
+
!**/gradle/wrapper/gradle-wrapper.jar
|
|
188
|
+
*.war
|
|
189
|
+
*.ear
|
|
190
|
+
*.zip
|
|
191
|
+
*.tar.gz
|
|
192
|
+
*.rar
|
|
193
|
+
|
|
194
|
+
# Eclipse
|
|
195
|
+
.classpath
|
|
196
|
+
.project
|
|
197
|
+
.settings/
|
|
198
|
+
|
|
199
|
+
# NetBeans
|
|
200
|
+
nbproject/private/
|
|
201
|
+
nbbuild/
|
|
202
|
+
nbdist/
|
|
203
|
+
.nb-gradle/
|
|
204
|
+
|
|
205
|
+
# JVM crash logs
|
|
206
|
+
hs_err_pid*
|
|
207
|
+
replay_pid*
|
|
208
|
+
|
|
209
|
+
# Test output (Java)
|
|
210
|
+
test-output/
|
|
211
|
+
surefire-reports/
|
|
212
|
+
failsafe-reports/
|
|
213
|
+
|
|
214
|
+
# ----------------
|
|
215
|
+
# Kotlin
|
|
216
|
+
# ----------------
|
|
217
|
+
# Gradle
|
|
218
|
+
.gradle/
|
|
219
|
+
|
|
220
|
+
# Kotlin compiled
|
|
221
|
+
out/
|
|
222
|
+
|
|
223
|
+
# ----------------
|
|
224
|
+
# Rust
|
|
225
|
+
# ----------------
|
|
226
|
+
/target/
|
|
227
|
+
Cargo.lock
|
|
228
|
+
*~
|
|
229
|
+
|
|
230
|
+
# ----------------
|
|
231
|
+
# Swift
|
|
232
|
+
# ----------------
|
|
233
|
+
# Xcode
|
|
234
|
+
*.xcodeproj
|
|
235
|
+
*.xcworkspace
|
|
236
|
+
xcuserdata/
|
|
237
|
+
DerivedData/
|
|
238
|
+
*.moved-aside
|
|
239
|
+
*.pbxuser
|
|
240
|
+
!default.pbxuser
|
|
241
|
+
*.mode1v3
|
|
242
|
+
!default.mode1v3
|
|
243
|
+
*.mode2v3
|
|
244
|
+
!default.mode2v3
|
|
245
|
+
*.perspectivev3
|
|
246
|
+
!default.perspectivev3
|
|
247
|
+
*.hmap
|
|
248
|
+
*.ipa
|
|
249
|
+
*.dSYM.zip
|
|
250
|
+
*.dSYM
|
|
251
|
+
|
|
252
|
+
# Swift Package Manager
|
|
253
|
+
.build/
|
|
254
|
+
.swiftpm/
|
|
255
|
+
Packages/
|
|
256
|
+
Package.resolved
|
|
257
|
+
|
|
258
|
+
# CocoaPods
|
|
259
|
+
Pods/
|
|
260
|
+
|
|
261
|
+
# Carthage
|
|
262
|
+
Carthage/Build/
|
|
263
|
+
Carthage/Checkouts
|
|
264
|
+
|
|
265
|
+
# Accio
|
|
266
|
+
Dependencies/
|
|
267
|
+
.accio/
|
|
268
|
+
|
|
269
|
+
# fastlane
|
|
270
|
+
fastlane/report.xml
|
|
271
|
+
fastlane/Preview.html
|
|
272
|
+
fastlane/screenshots/**/*.png
|
|
273
|
+
fastlane/test_output
|
|
274
|
+
|
|
275
|
+
# Code Injection
|
|
276
|
+
iOSInjectionProject/
|
|
277
|
+
|
|
278
|
+
# ----------------
|
|
279
|
+
# IDE / Editor
|
|
280
|
+
# ----------------
|
|
281
|
+
.idea/
|
|
282
|
+
*.iml
|
|
283
|
+
*.ipr
|
|
284
|
+
*.iws
|
|
285
|
+
.vscode/
|
|
286
|
+
*.swp
|
|
287
|
+
*.swo
|
|
288
|
+
.DS_Store
|
|
289
|
+
Thumbs.db
|
|
290
|
+
._*
|
|
291
|
+
.Spotlight-V100
|
|
292
|
+
.Trashes
|
|
293
|
+
ehthumbs.db
|
|
294
|
+
|
|
295
|
+
# Rider
|
|
296
|
+
*.sln.iml
|
|
297
|
+
|
|
298
|
+
# ----------------
|
|
299
|
+
# Docker
|
|
300
|
+
# ----------------
|
|
301
|
+
.docker/
|
|
302
|
+
|
|
303
|
+
# ----------------
|
|
304
|
+
# Logs & Output
|
|
305
|
+
# ----------------
|
|
306
|
+
logs/
|
|
307
|
+
*.log
|
|
308
|
+
|
|
309
|
+
# Audio output files (in root directories, not source code)
|
|
310
|
+
*.wav
|
|
311
|
+
*.mp3
|
|
312
|
+
# Note: Removed 'output.*' pattern as it incorrectly matches Output.java/Output.cs source files
|
|
313
|
+
|
|
314
|
+
# ----------------
|
|
315
|
+
# Misc
|
|
316
|
+
# ----------------
|
|
317
|
+
.npmrc
|
|
318
|
+
openapi.json
|
|
319
|
+
PR.md
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: typecast-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: Official Typecast Python SDK - Convert text to lifelike speech using AI-powered voices
|
|
5
5
|
Project-URL: Homepage, https://typecast.ai
|
|
6
6
|
Project-URL: Documentation, https://typecast.ai/docs/overview
|
|
7
|
-
Project-URL: Repository, https://github.com/neosapience/typecast-python
|
|
8
|
-
Project-URL: Issues, https://github.com/neosapience/typecast-
|
|
7
|
+
Project-URL: Repository, https://github.com/neosapience/typecast-sdk/tree/main/typecast-python
|
|
8
|
+
Project-URL: Issues, https://github.com/neosapience/typecast-sdk/issues
|
|
9
9
|
Author-email: Neosapience <help@typecast.ai>
|
|
10
10
|
Maintainer-email: Neosapience <help@typecast.ai>
|
|
11
11
|
License: Apache License
|
|
@@ -551,4 +551,4 @@ except TypecastError as e:
|
|
|
551
551
|
|
|
552
552
|
## License
|
|
553
553
|
|
|
554
|
-
[Apache-2.0](LICENSE) © [Neosapience](https://typecast.ai)
|
|
554
|
+
[Apache-2.0](LICENSE) © [Neosapience](https://typecast.ai/?lang=en)
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "typecast-python"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.7"
|
|
8
8
|
description = "Official Typecast Python SDK - Convert text to lifelike speech using AI-powered voices"
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "Neosapience", email = "help@typecast.ai"}
|
|
@@ -51,8 +51,8 @@ dev = [
|
|
|
51
51
|
[project.urls]
|
|
52
52
|
Homepage = "https://typecast.ai"
|
|
53
53
|
Documentation = "https://typecast.ai/docs/overview"
|
|
54
|
-
Repository = "https://github.com/neosapience/typecast-python"
|
|
55
|
-
Issues = "https://github.com/neosapience/typecast-
|
|
54
|
+
Repository = "https://github.com/neosapience/typecast-sdk/tree/main/typecast-python"
|
|
55
|
+
Issues = "https://github.com/neosapience/typecast-sdk/issues"
|
|
56
56
|
|
|
57
57
|
[tool.hatch.build.targets.wheel]
|
|
58
58
|
packages = ["src/typecast"]
|
|
@@ -86,7 +86,10 @@ multi_line_output = 3
|
|
|
86
86
|
|
|
87
87
|
[dependency-groups]
|
|
88
88
|
dev = [
|
|
89
|
+
"pytest>=7.0.0",
|
|
89
90
|
"pytest-cov>=7.0.0",
|
|
91
|
+
"pytest-mock>=3.14.0",
|
|
92
|
+
"pytest-asyncio>=0.21.0",
|
|
90
93
|
"python-dotenv>=1.1.1",
|
|
91
94
|
"ruff>=0.14.0",
|
|
92
95
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from enum import Enum
|
|
2
2
|
from typing import Literal, Optional, Union
|
|
3
3
|
|
|
4
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
4
|
+
from pydantic import BaseModel, ConfigDict, Field, model_validator
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class TTSModel(str, Enum):
|
|
@@ -122,13 +122,37 @@ TTSPrompt = Union[Prompt, PresetPrompt, SmartPrompt]
|
|
|
122
122
|
|
|
123
123
|
|
|
124
124
|
class Output(BaseModel):
|
|
125
|
-
volume: Optional[int] = Field(
|
|
125
|
+
volume: Optional[int] = Field(
|
|
126
|
+
default=100,
|
|
127
|
+
ge=0,
|
|
128
|
+
le=200,
|
|
129
|
+
description="Volume (0-200). Cannot be used together with target_lufs.",
|
|
130
|
+
)
|
|
131
|
+
target_lufs: Optional[float] = Field(
|
|
132
|
+
default=None,
|
|
133
|
+
ge=-70.0,
|
|
134
|
+
le=0.0,
|
|
135
|
+
description="Target loudness in LUFS for absolute loudness normalization (-70 to 0). Cannot be used together with volume.",
|
|
136
|
+
)
|
|
126
137
|
audio_pitch: Optional[int] = Field(default=0, ge=-12, le=12)
|
|
127
138
|
audio_tempo: Optional[float] = Field(default=1.0, ge=0.5, le=2.0)
|
|
128
139
|
audio_format: Optional[str] = Field(
|
|
129
140
|
default="wav", description="Audio format", examples=["wav", "mp3"]
|
|
130
141
|
)
|
|
131
142
|
|
|
143
|
+
@model_validator(mode="before")
|
|
144
|
+
@classmethod
|
|
145
|
+
def check_volume_and_target_lufs(cls, data: dict) -> dict:
|
|
146
|
+
if isinstance(data, dict):
|
|
147
|
+
target_lufs = data.get("target_lufs")
|
|
148
|
+
volume = data.get("volume")
|
|
149
|
+
volume_explicitly_set = "volume" in data
|
|
150
|
+
if target_lufs is not None and volume is not None and volume_explicitly_set:
|
|
151
|
+
raise ValueError("volume and target_lufs cannot be used together")
|
|
152
|
+
if target_lufs is not None and not volume_explicitly_set:
|
|
153
|
+
data["volume"] = None
|
|
154
|
+
return data
|
|
155
|
+
|
|
132
156
|
|
|
133
157
|
class TTSRequest(BaseModel):
|
|
134
158
|
model_config = ConfigDict(json_schema_extra={"exclude_none": True})
|
typecast_python-0.1.5/.gitignore
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# Python
|
|
2
|
-
__pycache__/
|
|
3
|
-
*.py[cod]
|
|
4
|
-
*$py.class
|
|
5
|
-
*.so
|
|
6
|
-
.Python
|
|
7
|
-
build/
|
|
8
|
-
develop-eggs/
|
|
9
|
-
dist/
|
|
10
|
-
downloads/
|
|
11
|
-
eggs/
|
|
12
|
-
.eggs/
|
|
13
|
-
lib/
|
|
14
|
-
lib64/
|
|
15
|
-
parts/
|
|
16
|
-
sdist/
|
|
17
|
-
var/
|
|
18
|
-
wheels/
|
|
19
|
-
*.egg-info/
|
|
20
|
-
.installed.cfg
|
|
21
|
-
*.egg
|
|
22
|
-
|
|
23
|
-
# Virtual Environment
|
|
24
|
-
.env
|
|
25
|
-
!.env.example
|
|
26
|
-
.venv
|
|
27
|
-
.test_venv
|
|
28
|
-
.ci_test_venv
|
|
29
|
-
env/
|
|
30
|
-
venv/
|
|
31
|
-
ENV/
|
|
32
|
-
|
|
33
|
-
# IDE
|
|
34
|
-
.idea/
|
|
35
|
-
.vscode/
|
|
36
|
-
*.swp
|
|
37
|
-
*.swo
|
|
38
|
-
|
|
39
|
-
# Docker
|
|
40
|
-
.docker/
|
|
41
|
-
|
|
42
|
-
# Tests
|
|
43
|
-
.coverage
|
|
44
|
-
htmlcov/
|
|
45
|
-
.pytest_cache/
|
|
46
|
-
.mypy_cache/
|
|
47
|
-
.ruff_cache/
|
|
48
|
-
|
|
49
|
-
# Logs
|
|
50
|
-
*.log
|
|
51
|
-
|
|
52
|
-
# Distribution
|
|
53
|
-
dist/
|
|
54
|
-
build/
|
|
55
|
-
|
|
56
|
-
*.wav
|
|
57
|
-
*.mp3
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|