syncsdk 0.2.1__tar.gz → 0.2.3__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.
Files changed (66) hide show
  1. {syncsdk-0.2.1 → syncsdk-0.2.3}/PKG-INFO +6 -8
  2. {syncsdk-0.2.1 → syncsdk-0.2.3}/README.md +5 -7
  3. {syncsdk-0.2.1 → syncsdk-0.2.3}/pyproject.toml +1 -1
  4. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/client.py +10 -4
  5. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/generation.py +5 -0
  6. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/model.py +1 -1
  7. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/core/client_wrapper.py +2 -2
  8. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/webhooks/types/generation_notification.py +5 -0
  9. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/__init__.py +0 -0
  10. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/batch/__init__.py +0 -0
  11. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/batch/client.py +0 -0
  12. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/batch/raw_client.py +0 -0
  13. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/__init__.py +0 -0
  14. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/errors/__init__.py +0 -0
  15. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/errors/bad_request_error.py +0 -0
  16. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/errors/internal_server_error.py +0 -0
  17. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/errors/not_found_error.py +0 -0
  18. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/errors/payment_required_error.py +0 -0
  19. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/errors/too_many_requests_error.py +0 -0
  20. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/errors/unauthorized_error.py +0 -0
  21. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/__init__.py +0 -0
  22. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/active_speaker.py +0 -0
  23. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/audio.py +0 -0
  24. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/batch_id.py +0 -0
  25. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/batch_metrics.py +0 -0
  26. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/batch_response.py +0 -0
  27. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/batch_status.py +0 -0
  28. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/create_batch_response.py +0 -0
  29. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/create_generation_dto.py +0 -0
  30. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/eleven_labs.py +0 -0
  31. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/estimated_generation_cost.py +0 -0
  32. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/generation_error.py +0 -0
  33. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/generation_error_message.py +0 -0
  34. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/generation_id.py +0 -0
  35. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/generation_options.py +0 -0
  36. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/generation_status.py +0 -0
  37. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/input.py +0 -0
  38. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/segment_frames.py +0 -0
  39. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/segment_secs.py +0 -0
  40. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/sync_mode.py +0 -0
  41. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/tts.py +0 -0
  42. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/tts_provider_config.py +0 -0
  43. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/validation_response.py +0 -0
  44. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/common/types/video.py +0 -0
  45. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/core/__init__.py +0 -0
  46. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/core/api_error.py +0 -0
  47. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/core/datetime_utils.py +0 -0
  48. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/core/file.py +0 -0
  49. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/core/http_client.py +0 -0
  50. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/core/http_response.py +0 -0
  51. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/core/jsonable_encoder.py +0 -0
  52. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/core/pydantic_utilities.py +0 -0
  53. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/core/query_encoder.py +0 -0
  54. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/core/remove_none_from_dict.py +0 -0
  55. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/core/request_options.py +0 -0
  56. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/core/serialization.py +0 -0
  57. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/core/unchecked_base_model.py +0 -0
  58. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/environment.py +0 -0
  59. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/generations/__init__.py +0 -0
  60. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/generations/client.py +0 -0
  61. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/generations/raw_client.py +0 -0
  62. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/py.typed +0 -0
  63. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/version.py +0 -0
  64. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/webhooks/__init__.py +0 -0
  65. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/webhooks/types/__init__.py +0 -0
  66. {syncsdk-0.2.1 → syncsdk-0.2.3}/src/sync/webhooks/types/webhook_status.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: syncsdk
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -24,12 +24,12 @@ 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
- # Sync Python Library
27
+ # Sync Python SDK
28
28
 
29
29
  [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fsynchronicity-labs%2Fsync-python-sdk)
30
30
  [![pypi](https://img.shields.io/pypi/v/syncsdk)](https://pypi.python.org/pypi/syncsdk)
31
31
 
32
- The Sync Python library provides convenient access to the Sync API from Python.
32
+ The Sync Python SDK provides convenient access to the Sync API from Python.
33
33
 
34
34
  ## Documentation
35
35
 
@@ -47,16 +47,14 @@ A full reference for this library is available [here](./reference.md).
47
47
 
48
48
  ## Usage
49
49
 
50
- Instantiate and use the client with the following:
50
+ Set SYNC_API_KEY environment variable to your [Sync](https://sync.so/settings/api-keys) and use the client with the following:
51
51
 
52
52
  ```python
53
53
  from sync import Sync
54
54
  from sync.common import Audio, GenerationOptions, Video
55
55
 
56
- client = Sync(
57
- api_key="YOUR_API_KEY",
58
- )
59
- client.generations.create(
56
+ sync = Sync()
57
+ sync.generations.create(
60
58
  input=[
61
59
  Video(
62
60
  url="https://assets.sync.so/docs/example-video.mp4",
@@ -1,9 +1,9 @@
1
- # Sync Python Library
1
+ # Sync Python SDK
2
2
 
3
3
  [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fsynchronicity-labs%2Fsync-python-sdk)
4
4
  [![pypi](https://img.shields.io/pypi/v/syncsdk)](https://pypi.python.org/pypi/syncsdk)
5
5
 
6
- The Sync Python library provides convenient access to the Sync API from Python.
6
+ The Sync Python SDK provides convenient access to the Sync API from Python.
7
7
 
8
8
  ## Documentation
9
9
 
@@ -21,16 +21,14 @@ A full reference for this library is available [here](./reference.md).
21
21
 
22
22
  ## Usage
23
23
 
24
- Instantiate and use the client with the following:
24
+ Set SYNC_API_KEY environment variable to your [Sync](https://sync.so/settings/api-keys) and use the client with the following:
25
25
 
26
26
  ```python
27
27
  from sync import Sync
28
28
  from sync.common import Audio, GenerationOptions, Video
29
29
 
30
- client = Sync(
31
- api_key="YOUR_API_KEY",
32
- )
33
- client.generations.create(
30
+ sync = Sync()
31
+ sync.generations.create(
34
32
  input=[
35
33
  Video(
36
34
  url="https://assets.sync.so/docs/example-video.mp4",
@@ -3,7 +3,7 @@ name = "syncsdk"
3
3
 
4
4
  [tool.poetry]
5
5
  name = "syncsdk"
6
- version = "0.2.1"
6
+ version = "0.2.3"
7
7
  description = ""
8
8
  readme = "README.md"
9
9
  authors = []
@@ -2,7 +2,9 @@
2
2
 
3
3
  import typing
4
4
  from .environment import SyncEnvironment
5
+ import os
5
6
  import httpx
7
+ from .core.api_error import ApiError
6
8
  from .core.client_wrapper import SyncClientWrapper
7
9
  from .batch.client import BatchClient
8
10
  from .generations.client import GenerationsClient
@@ -29,7 +31,7 @@ class Sync:
29
31
 
30
32
 
31
33
 
32
- api_key : str
34
+ api_key : typing.Optional[str]
33
35
  timeout : typing.Optional[float]
34
36
  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.
35
37
 
@@ -53,7 +55,7 @@ class Sync:
53
55
  *,
54
56
  base_url: typing.Optional[str] = None,
55
57
  environment: SyncEnvironment = SyncEnvironment.DEFAULT,
56
- api_key: str,
58
+ api_key: typing.Optional[str] = os.getenv("SYNC_API_KEY"),
57
59
  timeout: typing.Optional[float] = None,
58
60
  follow_redirects: typing.Optional[bool] = True,
59
61
  httpx_client: typing.Optional[httpx.Client] = None,
@@ -61,6 +63,8 @@ class Sync:
61
63
  _defaulted_timeout = (
62
64
  timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
63
65
  )
66
+ if api_key is None:
67
+ raise ApiError(body="The client must be instantiated be either passing in api_key or setting SYNC_API_KEY")
64
68
  self._client_wrapper = SyncClientWrapper(
65
69
  base_url=_get_base_url(base_url=base_url, environment=environment),
66
70
  api_key=api_key,
@@ -93,7 +97,7 @@ class AsyncSync:
93
97
 
94
98
 
95
99
 
96
- api_key : str
100
+ api_key : typing.Optional[str]
97
101
  timeout : typing.Optional[float]
98
102
  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.
99
103
 
@@ -117,7 +121,7 @@ class AsyncSync:
117
121
  *,
118
122
  base_url: typing.Optional[str] = None,
119
123
  environment: SyncEnvironment = SyncEnvironment.DEFAULT,
120
- api_key: str,
124
+ api_key: typing.Optional[str] = os.getenv("SYNC_API_KEY"),
121
125
  timeout: typing.Optional[float] = None,
122
126
  follow_redirects: typing.Optional[bool] = True,
123
127
  httpx_client: typing.Optional[httpx.AsyncClient] = None,
@@ -125,6 +129,8 @@ class AsyncSync:
125
129
  _defaulted_timeout = (
126
130
  timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
127
131
  )
132
+ if api_key is None:
133
+ raise ApiError(body="The client must be instantiated be either passing in api_key or setting SYNC_API_KEY")
128
134
  self._client_wrapper = AsyncClientWrapper(
129
135
  base_url=_get_base_url(base_url=base_url, environment=environment),
130
136
  api_key=api_key,
@@ -25,6 +25,11 @@ class Generation(UncheckedBaseModel):
25
25
  The error message if the generation failed.
26
26
  """
27
27
 
28
+ error_code: typing.Optional[str] = pydantic.Field(default=None)
29
+ """
30
+ The error code if the generation failed.
31
+ """
32
+
28
33
  id: GenerationId
29
34
  input: typing.List[Input] = pydantic.Field()
30
35
  """
@@ -2,4 +2,4 @@
2
2
 
3
3
  import typing
4
4
 
5
- Model = typing.Union[typing.Literal["lipsync-2", "lipsync-1.9.0-beta"], typing.Any]
5
+ Model = typing.Union[typing.Literal["lipsync-2", "lipsync-1.9.0-beta", "lipsync-2-pro"], typing.Any]
@@ -14,10 +14,10 @@ class BaseClientWrapper:
14
14
 
15
15
  def get_headers(self) -> typing.Dict[str, str]:
16
16
  headers: typing.Dict[str, str] = {
17
- "User-Agent": "syncsdk/0.2.1",
17
+ "User-Agent": "syncsdk/0.2.3",
18
18
  "X-Fern-Language": "Python",
19
19
  "X-Fern-SDK-Name": "syncsdk",
20
- "X-Fern-SDK-Version": "0.2.1",
20
+ "X-Fern-SDK-Version": "0.2.3",
21
21
  }
22
22
  headers["x-api-key"] = self.api_key
23
23
  return headers
@@ -37,6 +37,11 @@ class GenerationNotification(UncheckedBaseModel):
37
37
  error message if the generation failed
38
38
  """
39
39
 
40
+ error_code: typing.Optional[str] = pydantic.Field(default=None)
41
+ """
42
+ error code if the generation failed
43
+ """
44
+
40
45
  options: typing.Optional[GenerationOptions] = pydantic.Field(default=None)
41
46
  """
42
47
  options used for the generation
File without changes
File without changes
File without changes
File without changes
File without changes