murf 1.0.1__py3-none-any.whl → 1.1.1__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.
Potentially problematic release.
This version of murf might be problematic. Click here for more details.
- murf/__init__.py +28 -1
- murf/base_client.py +4 -0
- murf/client.py +3 -1
- murf/core/client_wrapper.py +1 -1
- murf/dubbing/__init__.py +14 -0
- murf/dubbing/client.py +26 -0
- murf/dubbing/jobs/__init__.py +5 -0
- murf/dubbing/jobs/client.py +712 -0
- murf/dubbing/jobs/types/__init__.py +6 -0
- murf/dubbing/jobs/types/jobs_create_request_priority.py +5 -0
- murf/dubbing/jobs/types/jobs_create_with_project_id_request_priority.py +5 -0
- murf/dubbing/languages/__init__.py +2 -0
- murf/dubbing/languages/client.py +369 -0
- murf/dubbing/projects/__init__.py +5 -0
- murf/dubbing/projects/client.py +682 -0
- murf/dubbing/projects/types/__init__.py +5 -0
- murf/dubbing/projects/types/api_create_project_request_dubbing_type.py +5 -0
- murf/dubbing_client.py +120 -0
- murf/types/__init__.py +24 -0
- murf/types/api_job_response.py +53 -0
- murf/types/api_job_response_dubbing_type.py +5 -0
- murf/types/api_job_response_priority.py +5 -0
- murf/types/api_project_response.py +44 -0
- murf/types/api_project_response_dubbing_type.py +5 -0
- murf/types/dub_api_detail_response.py +23 -0
- murf/types/dub_job_status_response.py +39 -0
- murf/types/form_data_content_disposition.py +31 -0
- murf/types/group_api_project_response.py +24 -0
- murf/types/locale_response.py +25 -0
- murf/types/locale_response_supports_item.py +5 -0
- murf/types/source_locale_response.py +20 -0
- {murf-1.0.1.dist-info → murf-1.1.1.dist-info}/METADATA +65 -17
- murf-1.1.1.dist-info/RECORD +70 -0
- murf-1.0.1.dist-info/RECORD +0 -44
- {murf-1.0.1.dist-info → murf-1.1.1.dist-info}/LICENSE +0 -0
- {murf-1.0.1.dist-info → murf-1.1.1.dist-info}/WHEEL +0 -0
murf/dubbing_client.py
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
from .base_client import BaseClient, AsyncBaseClient
|
|
2
|
+
from .environment import MurfEnvironment
|
|
3
|
+
import typing
|
|
4
|
+
import os
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
class MurfDub(BaseClient):
|
|
8
|
+
"""
|
|
9
|
+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
|
|
10
|
+
|
|
11
|
+
Parameters
|
|
12
|
+
----------
|
|
13
|
+
base_url : typing.Optional[str]
|
|
14
|
+
The base url to use for requests from the client.
|
|
15
|
+
|
|
16
|
+
environment : MurfEnvironment
|
|
17
|
+
The environment to use for requests from the client. from .environment import MurfEnvironment
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
Defaults to MurfEnvironment.DEFAULT
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
api_key : typing.Optional[str]
|
|
26
|
+
timeout : typing.Optional[float]
|
|
27
|
+
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
|
28
|
+
|
|
29
|
+
follow_redirects : typing.Optional[bool]
|
|
30
|
+
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
|
|
31
|
+
|
|
32
|
+
httpx_client : typing.Optional[httpx.Client]
|
|
33
|
+
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
|
34
|
+
|
|
35
|
+
Examples
|
|
36
|
+
--------
|
|
37
|
+
from murf import MurfDub
|
|
38
|
+
|
|
39
|
+
client = MurfDub(
|
|
40
|
+
api_key="YOUR_API_KEY",
|
|
41
|
+
)
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
def __init__(
|
|
45
|
+
self,
|
|
46
|
+
*,
|
|
47
|
+
base_url: typing.Optional[str] = None,
|
|
48
|
+
environment: MurfEnvironment = MurfEnvironment.DEFAULT,
|
|
49
|
+
api_key: typing.Optional[str] = os.getenv("MURFDUB_API_KEY"),
|
|
50
|
+
timeout: typing.Optional[float] = 60,
|
|
51
|
+
follow_redirects: typing.Optional[bool] = True,
|
|
52
|
+
httpx_client: typing.Optional[httpx.Client] = None,
|
|
53
|
+
):
|
|
54
|
+
super().__init__(
|
|
55
|
+
base_url=base_url,
|
|
56
|
+
environment=environment,
|
|
57
|
+
api_key=api_key,
|
|
58
|
+
timeout=timeout,
|
|
59
|
+
follow_redirects=follow_redirects,
|
|
60
|
+
httpx_client=httpx_client
|
|
61
|
+
)
|
|
62
|
+
self.text_to_speech = None # type: ignore
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class AsyncMurfDub(AsyncBaseClient):
|
|
66
|
+
"""
|
|
67
|
+
Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
|
|
68
|
+
|
|
69
|
+
Parameters
|
|
70
|
+
----------
|
|
71
|
+
base_url : typing.Optional[str]
|
|
72
|
+
The base url to use for requests from the client.
|
|
73
|
+
|
|
74
|
+
environment : MurfEnvironment
|
|
75
|
+
The environment to use for requests from the client. from .environment import MurfEnvironment
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
Defaults to MurfEnvironment.DEFAULT
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
api_key : typing.Optional[str]
|
|
84
|
+
timeout : typing.Optional[float]
|
|
85
|
+
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
|
86
|
+
|
|
87
|
+
follow_redirects : typing.Optional[bool]
|
|
88
|
+
Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
|
|
89
|
+
|
|
90
|
+
httpx_client : typing.Optional[httpx.AsyncClient]
|
|
91
|
+
The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
|
|
92
|
+
|
|
93
|
+
Examples
|
|
94
|
+
--------
|
|
95
|
+
from murf import AsyncMurfDub
|
|
96
|
+
|
|
97
|
+
client = AsyncMurfDub(
|
|
98
|
+
api_key="YOUR_API_KEY",
|
|
99
|
+
)
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
def __init__(
|
|
103
|
+
self,
|
|
104
|
+
*,
|
|
105
|
+
base_url: typing.Optional[str] = None,
|
|
106
|
+
environment: MurfEnvironment = MurfEnvironment.DEFAULT,
|
|
107
|
+
api_key: typing.Optional[str] = os.getenv("MURFDUB_API_KEY"),
|
|
108
|
+
timeout: typing.Optional[float] = 60,
|
|
109
|
+
follow_redirects: typing.Optional[bool] = True,
|
|
110
|
+
httpx_client: typing.Optional[httpx.AsyncClient] = None,
|
|
111
|
+
):
|
|
112
|
+
super().__init__(
|
|
113
|
+
base_url=base_url,
|
|
114
|
+
environment=environment,
|
|
115
|
+
api_key=api_key,
|
|
116
|
+
timeout=timeout,
|
|
117
|
+
follow_redirects=follow_redirects,
|
|
118
|
+
httpx_client=httpx_client
|
|
119
|
+
)
|
|
120
|
+
self.text_to_speech = None # type: ignore
|
murf/types/__init__.py
CHANGED
|
@@ -1,21 +1,45 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
+
from .api_job_response import ApiJobResponse
|
|
4
|
+
from .api_job_response_dubbing_type import ApiJobResponseDubbingType
|
|
5
|
+
from .api_job_response_priority import ApiJobResponsePriority
|
|
6
|
+
from .api_project_response import ApiProjectResponse
|
|
7
|
+
from .api_project_response_dubbing_type import ApiProjectResponseDubbingType
|
|
3
8
|
from .api_voice import ApiVoice
|
|
4
9
|
from .api_voice_gender import ApiVoiceGender
|
|
5
10
|
from .auth_token_response import AuthTokenResponse
|
|
11
|
+
from .dub_api_detail_response import DubApiDetailResponse
|
|
12
|
+
from .dub_job_status_response import DubJobStatusResponse
|
|
13
|
+
from .form_data_content_disposition import FormDataContentDisposition
|
|
6
14
|
from .generate_speech_response import GenerateSpeechResponse
|
|
15
|
+
from .group_api_project_response import GroupApiProjectResponse
|
|
16
|
+
from .locale_response import LocaleResponse
|
|
17
|
+
from .locale_response_supports_item import LocaleResponseSupportsItem
|
|
7
18
|
from .pronunciation_detail import PronunciationDetail
|
|
8
19
|
from .pronunciation_detail_type import PronunciationDetailType
|
|
20
|
+
from .source_locale_response import SourceLocaleResponse
|
|
9
21
|
from .style_details import StyleDetails
|
|
10
22
|
from .word_duration import WordDuration
|
|
11
23
|
|
|
12
24
|
__all__ = [
|
|
25
|
+
"ApiJobResponse",
|
|
26
|
+
"ApiJobResponseDubbingType",
|
|
27
|
+
"ApiJobResponsePriority",
|
|
28
|
+
"ApiProjectResponse",
|
|
29
|
+
"ApiProjectResponseDubbingType",
|
|
13
30
|
"ApiVoice",
|
|
14
31
|
"ApiVoiceGender",
|
|
15
32
|
"AuthTokenResponse",
|
|
33
|
+
"DubApiDetailResponse",
|
|
34
|
+
"DubJobStatusResponse",
|
|
35
|
+
"FormDataContentDisposition",
|
|
16
36
|
"GenerateSpeechResponse",
|
|
37
|
+
"GroupApiProjectResponse",
|
|
38
|
+
"LocaleResponse",
|
|
39
|
+
"LocaleResponseSupportsItem",
|
|
17
40
|
"PronunciationDetail",
|
|
18
41
|
"PronunciationDetailType",
|
|
42
|
+
"SourceLocaleResponse",
|
|
19
43
|
"StyleDetails",
|
|
20
44
|
"WordDuration",
|
|
21
45
|
]
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
from .api_job_response_dubbing_type import ApiJobResponseDubbingType
|
|
6
|
+
import pydantic
|
|
7
|
+
from .api_job_response_priority import ApiJobResponsePriority
|
|
8
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ApiJobResponse(UniversalBaseModel):
|
|
12
|
+
file_url: typing.Optional[str] = None
|
|
13
|
+
dubbing_type: ApiJobResponseDubbingType = pydantic.Field()
|
|
14
|
+
"""
|
|
15
|
+
Dubbing Type
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
webhook_url: typing.Optional[str] = None
|
|
19
|
+
file_name: str = pydantic.Field()
|
|
20
|
+
"""
|
|
21
|
+
Your Uploaded File Name
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
priority: ApiJobResponsePriority = pydantic.Field()
|
|
25
|
+
"""
|
|
26
|
+
Priority of the job. Allowed values: LOW, NORMAL, HIGH
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
source_locale: typing.Optional[str] = pydantic.Field(default=None)
|
|
30
|
+
"""
|
|
31
|
+
Source locale
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
job_id: str = pydantic.Field()
|
|
35
|
+
"""
|
|
36
|
+
Your Job Id
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
target_locales: typing.List[str] = pydantic.Field()
|
|
40
|
+
"""
|
|
41
|
+
List of target locales
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
warning: typing.Optional[str] = None
|
|
45
|
+
|
|
46
|
+
if IS_PYDANTIC_V2:
|
|
47
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
48
|
+
else:
|
|
49
|
+
|
|
50
|
+
class Config:
|
|
51
|
+
frozen = True
|
|
52
|
+
smart_union = True
|
|
53
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import pydantic
|
|
5
|
+
import typing
|
|
6
|
+
from .api_project_response_dubbing_type import ApiProjectResponseDubbingType
|
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ApiProjectResponse(UniversalBaseModel):
|
|
11
|
+
project_id: str = pydantic.Field()
|
|
12
|
+
"""
|
|
13
|
+
Your Project Id
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
name: typing.Optional[str] = pydantic.Field(default=None)
|
|
17
|
+
"""
|
|
18
|
+
Project Name
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
description: typing.Optional[str] = None
|
|
22
|
+
source_locale: typing.Optional[str] = pydantic.Field(default=None)
|
|
23
|
+
"""
|
|
24
|
+
Source Locale
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
dubbing_type: ApiProjectResponseDubbingType = pydantic.Field()
|
|
28
|
+
"""
|
|
29
|
+
Dubbing Type
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
target_locales: typing.List[str] = pydantic.Field()
|
|
33
|
+
"""
|
|
34
|
+
List of target locales
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
if IS_PYDANTIC_V2:
|
|
38
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
39
|
+
else:
|
|
40
|
+
|
|
41
|
+
class Config:
|
|
42
|
+
frozen = True
|
|
43
|
+
smart_union = True
|
|
44
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class DubApiDetailResponse(UniversalBaseModel):
|
|
10
|
+
locale: typing.Optional[str] = None
|
|
11
|
+
status: typing.Optional[str] = None
|
|
12
|
+
error_message: typing.Optional[str] = None
|
|
13
|
+
download_url: typing.Optional[str] = None
|
|
14
|
+
download_srt_url: typing.Optional[str] = None
|
|
15
|
+
|
|
16
|
+
if IS_PYDANTIC_V2:
|
|
17
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
18
|
+
else:
|
|
19
|
+
|
|
20
|
+
class Config:
|
|
21
|
+
frozen = True
|
|
22
|
+
smart_union = True
|
|
23
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
import pydantic
|
|
6
|
+
from .dub_api_detail_response import DubApiDetailResponse
|
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DubJobStatusResponse(UniversalBaseModel):
|
|
11
|
+
project_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
12
|
+
"""
|
|
13
|
+
Your Project Id
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
job_id: str = pydantic.Field()
|
|
17
|
+
"""
|
|
18
|
+
Your Job Id
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
status: str = pydantic.Field()
|
|
22
|
+
"""
|
|
23
|
+
Your Job Status
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
download_details: typing.Optional[typing.List[DubApiDetailResponse]] = None
|
|
27
|
+
credits_used: typing.Optional[int] = None
|
|
28
|
+
credits_remaining: typing.Optional[int] = None
|
|
29
|
+
failure_reason: typing.Optional[str] = None
|
|
30
|
+
failure_code: typing.Optional[str] = None
|
|
31
|
+
|
|
32
|
+
if IS_PYDANTIC_V2:
|
|
33
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
34
|
+
else:
|
|
35
|
+
|
|
36
|
+
class Config:
|
|
37
|
+
frozen = True
|
|
38
|
+
smart_union = True
|
|
39
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from ..core.serialization import FieldMetadata
|
|
7
|
+
import datetime as dt
|
|
8
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
|
+
import pydantic
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class FormDataContentDisposition(UniversalBaseModel):
|
|
13
|
+
type: typing.Optional[str] = None
|
|
14
|
+
parameters: typing.Optional[typing.Dict[str, str]] = None
|
|
15
|
+
file_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="fileName")] = None
|
|
16
|
+
creation_date: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="creationDate")] = None
|
|
17
|
+
modification_date: typing_extensions.Annotated[
|
|
18
|
+
typing.Optional[dt.datetime], FieldMetadata(alias="modificationDate")
|
|
19
|
+
] = None
|
|
20
|
+
read_date: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="readDate")] = None
|
|
21
|
+
size: typing.Optional[int] = None
|
|
22
|
+
name: typing.Optional[str] = None
|
|
23
|
+
|
|
24
|
+
if IS_PYDANTIC_V2:
|
|
25
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
26
|
+
else:
|
|
27
|
+
|
|
28
|
+
class Config:
|
|
29
|
+
frozen = True
|
|
30
|
+
smart_union = True
|
|
31
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
from .api_project_response import ApiProjectResponse
|
|
6
|
+
import pydantic
|
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class GroupApiProjectResponse(UniversalBaseModel):
|
|
11
|
+
next: typing.Optional[str] = None
|
|
12
|
+
projects: typing.List[ApiProjectResponse] = pydantic.Field()
|
|
13
|
+
"""
|
|
14
|
+
List of Projects
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
if IS_PYDANTIC_V2:
|
|
18
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
19
|
+
else:
|
|
20
|
+
|
|
21
|
+
class Config:
|
|
22
|
+
frozen = True
|
|
23
|
+
smart_union = True
|
|
24
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
from .locale_response_supports_item import LocaleResponseSupportsItem
|
|
6
|
+
import pydantic
|
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class LocaleResponse(UniversalBaseModel):
|
|
11
|
+
locale: str
|
|
12
|
+
language: str
|
|
13
|
+
supports: typing.List[LocaleResponseSupportsItem] = pydantic.Field()
|
|
14
|
+
"""
|
|
15
|
+
Dubbing Type supported by locale
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
if IS_PYDANTIC_V2:
|
|
19
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
20
|
+
else:
|
|
21
|
+
|
|
22
|
+
class Config:
|
|
23
|
+
frozen = True
|
|
24
|
+
smart_union = True
|
|
25
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
5
|
+
import typing
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class SourceLocaleResponse(UniversalBaseModel):
|
|
10
|
+
locale: str
|
|
11
|
+
language: str
|
|
12
|
+
|
|
13
|
+
if IS_PYDANTIC_V2:
|
|
14
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
15
|
+
else:
|
|
16
|
+
|
|
17
|
+
class Config:
|
|
18
|
+
frozen = True
|
|
19
|
+
smart_union = True
|
|
20
|
+
extra = pydantic.Extra.allow
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: murf
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary:
|
|
5
5
|
Requires-Python: >=3.8,<4.0
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
@@ -24,26 +24,49 @@ Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
|
|
|
24
24
|
Requires-Dist: typing_extensions (>=4.0.0)
|
|
25
25
|
Description-Content-Type: text/markdown
|
|
26
26
|
|
|
27
|
-
# Murf Python
|
|
27
|
+
# Murf Python SDK
|
|
28
|
+
|
|
29
|
+

|
|
28
30
|
|
|
29
31
|
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fmurf-ai%2Fmurf-python-sdk)
|
|
30
32
|
[](https://pypi.python.org/pypi/murf)
|
|
33
|
+
[](https://colab.research.google.com/gist/devgeetech-murf/bbe2c7eb01433f4a151f0fd2be23b1c8/murf-python-sdk.ipynb)
|
|
34
|
+
|
|
35
|
+
## Table of Contents
|
|
36
|
+
|
|
37
|
+
- [Overview](#overview)
|
|
38
|
+
- [Installation](#installation)
|
|
39
|
+
- [Getting Started](#getting-started)
|
|
40
|
+
- [Features](#features)
|
|
41
|
+
- [Asynchronous Usage](#async-client)
|
|
42
|
+
- [Exception Handling](#exception-handling)
|
|
43
|
+
- [Advanced Configuration](#advanced)
|
|
44
|
+
- [Contributing](#contributing)
|
|
45
|
+
- [License](#license)
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Overview
|
|
50
|
+
|
|
51
|
+
The Murf Python SDK offers seamless integration with the [Murf AI](https://murf.ai/) [text-to-speech software](https://murf.ai/text-to-speech), enabling developers and creators to convert text into lifelike speech effortlessly. With over 130 natural-sounding voices across 13+ languages and 20+ speaking styles, Murf provides unparalleled speech customization for a wide range of applications. The SDK is designed for both synchronous and asynchronous workflows, featuring robust error handling, advanced configuration options, and support for real-time applications.
|
|
31
52
|
|
|
32
|
-
|
|
53
|
+
---
|
|
33
54
|
|
|
34
55
|
## Installation
|
|
35
56
|
|
|
36
|
-
|
|
57
|
+
Check out the [HTTP API documentation](https://murf.ai/api/docs/introduction/quickstart).
|
|
58
|
+
|
|
59
|
+
Install the SDK using pip:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
37
62
|
pip install murf
|
|
38
63
|
```
|
|
39
64
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
A full reference for this library is available [here](./reference.md).
|
|
65
|
+
---
|
|
43
66
|
|
|
44
|
-
##
|
|
67
|
+
## Getting Started
|
|
45
68
|
|
|
46
|
-
|
|
69
|
+
Here's a quick example to get you started with the Murf SDK:
|
|
47
70
|
|
|
48
71
|
```python
|
|
49
72
|
from murf import Murf
|
|
@@ -52,7 +75,6 @@ client = Murf(
|
|
|
52
75
|
api_key="YOUR_API_KEY",
|
|
53
76
|
)
|
|
54
77
|
client.text_to_speech.generate(
|
|
55
|
-
channel_type="STEREO",
|
|
56
78
|
format="MP3",
|
|
57
79
|
sample_rate=44100.0,
|
|
58
80
|
text="Hello, world!",
|
|
@@ -60,6 +82,25 @@ client.text_to_speech.generate(
|
|
|
60
82
|
)
|
|
61
83
|
```
|
|
62
84
|
|
|
85
|
+
For more detailed information, refer to the [official documentation](https://murf.ai/api/docs/introduction/quickstart).
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Features
|
|
90
|
+
|
|
91
|
+
- **Text-to-Speech Conversion:** Transform text into natural-sounding speech.
|
|
92
|
+
- **Multilingual Support:** Access voices in over 13 languages, including English, French, German, Spanish, Italian, Hindi, Portuguese, Dutch, Korean, Chinese (Mandarin), Bengali, Tamil, and Polish.
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+
- **Multiple Voice Styles:** Choose from 20+ speaking styles to suit your application's needs.
|
|
97
|
+
- **Advanced Voice Customization:** Adjust parameters like pitch, speed, pauses, and pronunciation for optimal output. Fine-grained controls let you tailor the voice output to match your specific requirements.
|
|
98
|
+
- **Multiple Audio Formats:** Generate audio in various formats (e.g., MP3, WAV) with configurable sample rates for optimal quality.
|
|
99
|
+
- **Real-Time Processing:** Benefit from asynchronous API calls that support non-blocking, real-time audio generation and streaming scenarios.
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
63
104
|
## Async Client
|
|
64
105
|
|
|
65
106
|
The SDK also exports an `async` client so that you can make non-blocking calls to our API.
|
|
@@ -76,7 +117,6 @@ client = AsyncMurf(
|
|
|
76
117
|
|
|
77
118
|
async def main() -> None:
|
|
78
119
|
await client.text_to_speech.generate(
|
|
79
|
-
channel_type="STEREO",
|
|
80
120
|
format="MP3",
|
|
81
121
|
sample_rate=44100.0,
|
|
82
122
|
text="Hello, world!",
|
|
@@ -87,6 +127,8 @@ async def main() -> None:
|
|
|
87
127
|
asyncio.run(main())
|
|
88
128
|
```
|
|
89
129
|
|
|
130
|
+
---
|
|
131
|
+
|
|
90
132
|
## Exception Handling
|
|
91
133
|
|
|
92
134
|
When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
|
|
@@ -102,6 +144,8 @@ except ApiError as e:
|
|
|
102
144
|
print(e.body)
|
|
103
145
|
```
|
|
104
146
|
|
|
147
|
+
---
|
|
148
|
+
|
|
105
149
|
## Advanced
|
|
106
150
|
|
|
107
151
|
### Retries
|
|
@@ -161,13 +205,17 @@ client = Murf(
|
|
|
161
205
|
)
|
|
162
206
|
```
|
|
163
207
|
|
|
208
|
+
---
|
|
209
|
+
|
|
164
210
|
## Contributing
|
|
165
211
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
212
|
+
We welcome contributions to enhance the Murf Python SDK. Please note that this library is generated programmatically, so direct modifications may be overwritten. We suggest opening an issue first to discuss your ideas or improvements. Contributions to the documentation are especially appreciated! For any support queries email to support@murf.ai
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## License
|
|
217
|
+
|
|
218
|
+
Murf Python SDK is released under the [MIT License](LICENSE).
|
|
171
219
|
|
|
172
|
-
|
|
220
|
+
---
|
|
173
221
|
|