typecast-python 0.3.8__py3-none-any.whl → 0.3.9__py3-none-any.whl

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/async_client.py CHANGED
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  import asyncio
2
4
  from pathlib import Path
3
5
  from typing import AsyncIterator, BinaryIO, Optional, Union
@@ -208,7 +210,8 @@ class AsyncTypecast:
208
210
  seed=seed,
209
211
  )
210
212
  )
211
- await asyncio.to_thread(output_path.write_bytes, response.audio_data)
213
+ loop = asyncio.get_running_loop()
214
+ await loop.run_in_executor(None, output_path.write_bytes, response.audio_data)
212
215
  return response
213
216
 
214
217
  async def text_to_speech_stream(
@@ -255,7 +258,7 @@ class AsyncTypecast:
255
258
  error_text = await response.text()
256
259
  self._handle_error(response.status, error_text)
257
260
 
258
- async for chunk in response.content.iter_chunked(chunk_size):
261
+ async for chunk in response.content.iter_chunked(chunk_size): # pragma: no branch
259
262
  yield chunk
260
263
 
261
264
  async def text_to_speech_with_timestamps(
typecast/client.py CHANGED
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from pathlib import Path
2
4
  from typing import BinaryIO, Iterator, Optional, Union
3
5
  from urllib.parse import quote
typecast/models/tts.py CHANGED
@@ -1,5 +1,7 @@
1
+ from __future__ import annotations
2
+
1
3
  from enum import Enum
2
- from typing import Literal, Optional, Union
4
+ from typing import List, Literal, Optional, Union
3
5
 
4
6
  from pydantic import BaseModel, ConfigDict, Field, model_validator
5
7
 
@@ -330,7 +332,7 @@ def _group_into_cues(
330
332
  word_mode=True: parts are joined with a single space.
331
333
  word_mode=False: parts are concatenated directly.
332
334
 
333
- Returns list[(text, start, end)] tuples.
335
+ Returns List[(text, start, end)] tuples.
334
336
  """
335
337
  cues = []
336
338
  cur_text_parts = []
@@ -404,11 +406,11 @@ class TTSWithTimestampsResponse(BaseModel):
404
406
  audio: str = Field(description="Base64-encoded audio bytes.")
405
407
  audio_format: Literal["wav", "mp3"] = Field(description="Audio encoding format.")
406
408
  audio_duration: float = Field(description="Length of audio in seconds.")
407
- words: Optional[list[AlignmentSegmentWord]] = Field(
409
+ words: Optional[List[AlignmentSegmentWord]] = Field(
408
410
  default=None,
409
411
  description="Word-level timestamps; null when granularity=char.",
410
412
  )
411
- characters: Optional[list[AlignmentSegmentCharacter]] = Field(
413
+ characters: Optional[List[AlignmentSegmentCharacter]] = Field(
412
414
  default=None,
413
415
  description="Character-level timestamps; null when granularity=word.",
414
416
  )
typecast/models/voices.py CHANGED
@@ -1,5 +1,7 @@
1
+ from __future__ import annotations
2
+
1
3
  from enum import Enum
2
- from typing import Optional
4
+ from typing import List, Optional
3
5
 
4
6
  from pydantic import BaseModel, Field
5
7
 
@@ -12,7 +14,7 @@ class VoicesResponse(BaseModel):
12
14
  voice_id: str
13
15
  voice_name: str
14
16
  model: str
15
- emotions: list[str]
17
+ emotions: List[str]
16
18
 
17
19
 
18
20
  class GenderEnum(str, Enum):
@@ -54,7 +56,7 @@ class ModelInfo(BaseModel):
54
56
  """Model information with supported emotions"""
55
57
 
56
58
  version: TTSModel
57
- emotions: list[str]
59
+ emotions: List[str]
58
60
 
59
61
 
60
62
  class VoiceV2Response(BaseModel):
@@ -62,10 +64,10 @@ class VoiceV2Response(BaseModel):
62
64
 
63
65
  voice_id: str
64
66
  voice_name: str
65
- models: list[ModelInfo]
67
+ models: List[ModelInfo]
66
68
  gender: Optional[GenderEnum] = None
67
69
  age: Optional[AgeEnum] = None
68
- use_cases: Optional[list[str]] = None
70
+ use_cases: Optional[List[str]] = None
69
71
 
70
72
 
71
73
  class RecommendedVoice(BaseModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: typecast-python
3
- Version: 0.3.8
3
+ Version: 0.3.9
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
@@ -217,26 +217,30 @@ Classifier: Intended Audience :: Developers
217
217
  Classifier: License :: OSI Approved :: Apache Software License
218
218
  Classifier: Operating System :: OS Independent
219
219
  Classifier: Programming Language :: Python :: 3
220
+ Classifier: Programming Language :: Python :: 3.8
221
+ Classifier: Programming Language :: Python :: 3.9
222
+ Classifier: Programming Language :: Python :: 3.10
220
223
  Classifier: Programming Language :: Python :: 3.11
221
224
  Classifier: Programming Language :: Python :: 3.12
222
225
  Classifier: Programming Language :: Python :: 3.13
226
+ Classifier: Programming Language :: Python :: 3.14
223
227
  Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
224
228
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
225
- Requires-Python: >=3.11
226
- Requires-Dist: aiohttp>=3.14.0
229
+ Requires-Python: <3.15,>=3.8
230
+ Requires-Dist: aiohttp>=3.9.0
227
231
  Requires-Dist: pydantic>=2.0.0
228
232
  Requires-Dist: requests>=2.28.0
229
233
  Requires-Dist: typing-extensions>=4.0.0
230
234
  Provides-Extra: dev
231
235
  Requires-Dist: aioresponses>=0.7.6; extra == 'dev'
232
- Requires-Dist: black>=23.0.0; extra == 'dev'
233
- Requires-Dist: flake8>=6.0.0; extra == 'dev'
236
+ Requires-Dist: black<25.0.0,>=23.0.0; extra == 'dev'
237
+ Requires-Dist: flake8<6.0.0,>=5.0.0; extra == 'dev'
234
238
  Requires-Dist: isort>=5.0.0; extra == 'dev'
235
- Requires-Dist: mypy>=1.0.0; extra == 'dev'
236
- Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
237
- Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
239
+ Requires-Dist: mypy<1.11.0,>=1.0.0; extra == 'dev'
240
+ Requires-Dist: pytest-asyncio<1.0.0,>=0.21.0; extra == 'dev'
241
+ Requires-Dist: pytest-cov<6.0.0,>=5.0.0; extra == 'dev'
238
242
  Requires-Dist: pytest-mock>=3.14.0; extra == 'dev'
239
- Requires-Dist: pytest>=7.0.0; extra == 'dev'
243
+ Requires-Dist: pytest<9.0.0,>=7.0.0; extra == 'dev'
240
244
  Description-Content-Type: text/markdown
241
245
 
242
246
  <div align="center">
@@ -250,7 +254,7 @@ Convert text to lifelike speech using AI-powered voices
250
254
  [![PyPI version](https://img.shields.io/pypi/v/typecast-python.svg?style=flat-square)](https://pypi.org/project/typecast-python/)
251
255
  [![coverage](https://img.shields.io/badge/coverage-100%25-brightgreen.svg?style=flat-square)](../docs/coverage-policy.md)
252
256
  [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg?style=flat-square)](LICENSE)
253
- [![Python](https://img.shields.io/badge/Python-3.9+-3776ab.svg?style=flat-square&logo=python&logoColor=white)](https://www.python.org/)
257
+ [![Python](https://img.shields.io/badge/Python-3.8--3.14-3776ab.svg?style=flat-square&logo=python&logoColor=white)](https://www.python.org/)
254
258
 
255
259
  [Documentation](https://typecast.ai/docs) | [API Reference](https://typecast.ai/docs/api-reference) | [Get API Key](https://typecast.ai/developers/api/api-key)
256
260
 
@@ -1,8 +1,8 @@
1
1
  typecast/__init__.py,sha256=L6m0Z1jn1UgGjPp9AFiTwhHk9DVV_B4WrLfQDEfbcZI,1093
2
2
  typecast/_user_agent.py,sha256=R_0eSKpuP9jLp_wDJcJGFvFtUh9BZwEgsT1buVeHRAA,1786
3
3
  typecast/_voice_clone.py,sha256=TN2tbB3b5lC5uFCBnbERhz37bNJlbv6VZ-vj70EfTs4,3464
4
- typecast/async_client.py,sha256=H3hCoGb6h0UyrnYUlQ0lhnpaCV-hxnZtsQKYlqaGPSk,21592
5
- typecast/client.py,sha256=VPZVRnB9_T4VkSlrHpKLRahhEaxIF05XUAk-skqYKz8,20850
4
+ typecast/async_client.py,sha256=Gidl-gj0zGMzZCPzmMRcr2GiYFi0cBmZOwrLhSVRL_Y,21700
5
+ typecast/client.py,sha256=CL_Uw_PYRUwGT5CqLhZRXTGwY6Sum69TJ_S_2XPe56s,20886
6
6
  typecast/composer.py,sha256=r1kpRGlSJ1s4C1PkE7yIpGwnKtxYfIdFSLWaf8v1RAQ,9422
7
7
  typecast/conf.py,sha256=yfOHYZDvIshWWMriN5wE0GFPR8AX3zv4Rg2655OvA9Q,724
8
8
  typecast/exceptions.py,sha256=Y0ZzYebe8zOSOSAHbXfKR0G_RJgdmZXxi15Z7ZxPLIk,1568
@@ -10,9 +10,9 @@ typecast/utils.py,sha256=XuNuX7gW8_CGKqZ-cv_tKlPVMPBluAYJBw2clwmjIMI,708
10
10
  typecast/models/__init__.py,sha256=OmaFdGpH6gK7EJyNgvbwqZHXVxjnWKJzynn7D3pfULo,1249
11
11
  typecast/models/error.py,sha256=XomIjx7jvlCjItqzJuCAT4mXC9jwTjxR8lLDUk6P8KA,152
12
12
  typecast/models/subscription.py,sha256=EIaAAo3cCRw8LYT_O6D9AVwxqIHrWCijzl4UTx7FZB8,894
13
- typecast/models/tts.py,sha256=W2Bp9M-xPJPODlk89P9CnLA2fwb__4SR4yoMkG_O8kA,16453
14
- typecast/models/voices.py,sha256=3yJD78QbZe3pTZv61GnB8up8qlIHKd1iSe5Bow-4ocU,2645
15
- typecast_python-0.3.8.dist-info/METADATA,sha256=5Gbl-QxbRCGnqUwn_8Yr2xssRMZD_3GvZghgWsUxByg,25530
16
- typecast_python-0.3.8.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
17
- typecast_python-0.3.8.dist-info/licenses/LICENSE,sha256=HvtJ-S89uUkuYmt-OvVk4MRxmzwtbn84__qJtSrGU2Q,11348
18
- typecast_python-0.3.8.dist-info/RECORD,,
13
+ typecast/models/tts.py,sha256=xiO1e936vFr7vZqUErTEhexydoaMem6BcY_x1A1zFow,16495
14
+ typecast/models/voices.py,sha256=3UeBLwAlaNbQQUrt7FO18zqczLoP7jmi2x68yaUtllU,2687
15
+ typecast_python-0.3.9.dist-info/METADATA,sha256=taFaWuIBmeksyE5K_jUbiyx5376Cxq4xElMRTHASads,25785
16
+ typecast_python-0.3.9.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
17
+ typecast_python-0.3.9.dist-info/licenses/LICENSE,sha256=HvtJ-S89uUkuYmt-OvVk4MRxmzwtbn84__qJtSrGU2Q,11348
18
+ typecast_python-0.3.9.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.30.1
2
+ Generator: hatchling 1.31.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any