motor-python-sdk 0.0.2__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 (60) hide show
  1. motor_python_sdk-0.0.2/PKG-INFO +230 -0
  2. motor_python_sdk-0.0.2/README.md +198 -0
  3. motor_python_sdk-0.0.2/pyproject.toml +97 -0
  4. motor_python_sdk-0.0.2/src/yasminaai/__init__.py +113 -0
  5. motor_python_sdk-0.0.2/src/yasminaai/_default_clients.py +32 -0
  6. motor_python_sdk-0.0.2/src/yasminaai/client.py +255 -0
  7. motor_python_sdk-0.0.2/src/yasminaai/core/__init__.py +127 -0
  8. motor_python_sdk-0.0.2/src/yasminaai/core/api_error.py +23 -0
  9. motor_python_sdk-0.0.2/src/yasminaai/core/client_wrapper.py +119 -0
  10. motor_python_sdk-0.0.2/src/yasminaai/core/datetime_utils.py +70 -0
  11. motor_python_sdk-0.0.2/src/yasminaai/core/file.py +67 -0
  12. motor_python_sdk-0.0.2/src/yasminaai/core/force_multipart.py +18 -0
  13. motor_python_sdk-0.0.2/src/yasminaai/core/http_client.py +839 -0
  14. motor_python_sdk-0.0.2/src/yasminaai/core/http_response.py +59 -0
  15. motor_python_sdk-0.0.2/src/yasminaai/core/http_sse/__init__.py +42 -0
  16. motor_python_sdk-0.0.2/src/yasminaai/core/http_sse/_api.py +170 -0
  17. motor_python_sdk-0.0.2/src/yasminaai/core/http_sse/_decoders.py +61 -0
  18. motor_python_sdk-0.0.2/src/yasminaai/core/http_sse/_exceptions.py +7 -0
  19. motor_python_sdk-0.0.2/src/yasminaai/core/http_sse/_models.py +17 -0
  20. motor_python_sdk-0.0.2/src/yasminaai/core/jsonable_encoder.py +120 -0
  21. motor_python_sdk-0.0.2/src/yasminaai/core/logging.py +107 -0
  22. motor_python_sdk-0.0.2/src/yasminaai/core/parse_error.py +36 -0
  23. motor_python_sdk-0.0.2/src/yasminaai/core/pydantic_utilities.py +508 -0
  24. motor_python_sdk-0.0.2/src/yasminaai/core/query_encoder.py +58 -0
  25. motor_python_sdk-0.0.2/src/yasminaai/core/remove_none_from_dict.py +11 -0
  26. motor_python_sdk-0.0.2/src/yasminaai/core/request_options.py +35 -0
  27. motor_python_sdk-0.0.2/src/yasminaai/core/serialization.py +347 -0
  28. motor_python_sdk-0.0.2/src/yasminaai/environment.py +7 -0
  29. motor_python_sdk-0.0.2/src/yasminaai/errors/__init__.py +42 -0
  30. motor_python_sdk-0.0.2/src/yasminaai/errors/bad_request_error.py +10 -0
  31. motor_python_sdk-0.0.2/src/yasminaai/errors/not_found_error.py +10 -0
  32. motor_python_sdk-0.0.2/src/yasminaai/errors/unauthorized_error.py +10 -0
  33. motor_python_sdk-0.0.2/src/yasminaai/errors/unprocessable_entity_error.py +10 -0
  34. motor_python_sdk-0.0.2/src/yasminaai/ot_ps/__init__.py +4 -0
  35. motor_python_sdk-0.0.2/src/yasminaai/ot_ps/client.py +278 -0
  36. motor_python_sdk-0.0.2/src/yasminaai/ot_ps/raw_client.py +355 -0
  37. motor_python_sdk-0.0.2/src/yasminaai/policies/__init__.py +4 -0
  38. motor_python_sdk-0.0.2/src/yasminaai/policies/client.py +393 -0
  39. motor_python_sdk-0.0.2/src/yasminaai/policies/raw_client.py +493 -0
  40. motor_python_sdk-0.0.2/src/yasminaai/py.typed +0 -0
  41. motor_python_sdk-0.0.2/src/yasminaai/quotes/__init__.py +49 -0
  42. motor_python_sdk-0.0.2/src/yasminaai/quotes/client.py +438 -0
  43. motor_python_sdk-0.0.2/src/yasminaai/quotes/raw_client.py +548 -0
  44. motor_python_sdk-0.0.2/src/yasminaai/quotes/types/__init__.py +47 -0
  45. motor_python_sdk-0.0.2/src/yasminaai/quotes/types/delete_quote_requests_id_response.py +19 -0
  46. motor_python_sdk-0.0.2/src/yasminaai/quotes/types/get_quote_requests_response.py +37 -0
  47. motor_python_sdk-0.0.2/src/yasminaai/quotes/types/get_quote_requests_response_links_item.py +21 -0
  48. motor_python_sdk-0.0.2/src/yasminaai/quotes/types/post_quote_requests_request_drivers_item.py +33 -0
  49. motor_python_sdk-0.0.2/src/yasminaai/types/__init__.py +65 -0
  50. motor_python_sdk-0.0.2/src/yasminaai/types/bad_request_error_body.py +20 -0
  51. motor_python_sdk-0.0.2/src/yasminaai/types/benefit.py +24 -0
  52. motor_python_sdk-0.0.2/src/yasminaai/types/company_quote.py +23 -0
  53. motor_python_sdk-0.0.2/src/yasminaai/types/error.py +20 -0
  54. motor_python_sdk-0.0.2/src/yasminaai/types/policy.py +33 -0
  55. motor_python_sdk-0.0.2/src/yasminaai/types/quote_price.py +24 -0
  56. motor_python_sdk-0.0.2/src/yasminaai/types/quote_response.py +90 -0
  57. motor_python_sdk-0.0.2/src/yasminaai/types/quote_response_drivers_item.py +33 -0
  58. motor_python_sdk-0.0.2/src/yasminaai/types/quote_response_quotes_item.py +30 -0
  59. motor_python_sdk-0.0.2/src/yasminaai/types/unauthorized_error_body.py +20 -0
  60. motor_python_sdk-0.0.2/src/yasminaai/version.py +3 -0
@@ -0,0 +1,230 @@
1
+ Metadata-Version: 2.1
2
+ Name: motor-python-sdk
3
+ Version: 0.0.2
4
+ Summary:
5
+ Requires-Python: >=3.10,<4.0
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Operating System :: MacOS
8
+ Classifier: Operating System :: Microsoft :: Windows
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Operating System :: POSIX
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Programming Language :: Python :: 3.15
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Typing :: Typed
22
+ Provides-Extra: aiohttp
23
+ Requires-Dist: aiohttp (>=3.14.0,<4) ; (python_version >= "3.10") and (extra == "aiohttp")
24
+ Requires-Dist: httpx (>=0.21.2)
25
+ Requires-Dist: httpx-aiohttp (==0.1.8) ; (python_version >= "3.10") and (extra == "aiohttp")
26
+ Requires-Dist: pydantic (>=1.9.2)
27
+ Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
28
+ Requires-Dist: typing_extensions (>=4.0.0)
29
+ Project-URL: Repository, https://github.com/YasminaAI/motor-python-sdk
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Yasminaai Python Library
33
+
34
+ [![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%2FYasminaAI%2Fmotor-python-sdk)
35
+ [![pypi](https://img.shields.io/pypi/v/motor-python-sdk)](https://pypi.python.org/pypi/motor-python-sdk)
36
+
37
+ The Yasminaai Python library provides convenient access to the Yasminaai APIs from Python.
38
+
39
+ ## Table of Contents
40
+
41
+ - [Installation](#installation)
42
+ - [Reference](#reference)
43
+ - [Usage](#usage)
44
+ - [Environments](#environments)
45
+ - [Async Client](#async-client)
46
+ - [Exception Handling](#exception-handling)
47
+ - [Advanced](#advanced)
48
+ - [Access Raw Response Data](#access-raw-response-data)
49
+ - [Retries](#retries)
50
+ - [Timeouts](#timeouts)
51
+ - [Custom Client](#custom-client)
52
+ - [Contributing](#contributing)
53
+
54
+ ## Installation
55
+
56
+ ```sh
57
+ pip install motor-python-sdk
58
+ ```
59
+
60
+ ## Reference
61
+
62
+ A full reference for this library is available [here](https://github.com/YasminaAI/motor-python-sdk/blob/HEAD/./reference.md).
63
+
64
+ ## Usage
65
+
66
+ Instantiate and use the client with the following:
67
+
68
+ ```python
69
+ from yasminaai import YasminaaiApi
70
+ import datetime
71
+
72
+ client = YasminaaiApi(
73
+ token="<token>",
74
+ )
75
+
76
+ client.quotes.request_quotes(
77
+ owner_id="owner_id",
78
+ phone="phone",
79
+ birthdate=datetime.date.fromisoformat("2023-01-15"),
80
+ car_sequence_number="car_sequence_number",
81
+ car_estimated_cost=1.1,
82
+ )
83
+ ```
84
+
85
+ ## Environments
86
+
87
+ This SDK allows you to configure different environments for API requests.
88
+
89
+ ```python
90
+ from yasminaai import YasminaaiApi
91
+ from yasminaai.environment import YasminaaiApiEnvironment
92
+
93
+ client = YasminaaiApi(
94
+ environment=YasminaaiApiEnvironment.DEFAULT,
95
+ )
96
+ ```
97
+
98
+ ## Async Client
99
+
100
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
101
+
102
+ ```python
103
+ import asyncio
104
+ import datetime
105
+
106
+ from yasminaai import AsyncYasminaaiApi
107
+
108
+ client = AsyncYasminaaiApi(
109
+ token="<token>",
110
+ )
111
+
112
+
113
+ async def main() -> None:
114
+ await client.quotes.request_quotes(
115
+ owner_id="owner_id",
116
+ phone="phone",
117
+ birthdate=datetime.date.fromisoformat("2023-01-15"),
118
+ car_sequence_number="car_sequence_number",
119
+ car_estimated_cost=1.1,
120
+ )
121
+
122
+
123
+ asyncio.run(main())
124
+ ```
125
+
126
+ ## Exception Handling
127
+
128
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
129
+ will be thrown.
130
+
131
+ ```python
132
+ from yasminaai.core.api_error import ApiError
133
+
134
+ try:
135
+ client.quotes.request_quotes(...)
136
+ except ApiError as e:
137
+ print(e.status_code)
138
+ print(e.body)
139
+ ```
140
+
141
+ ## Advanced
142
+
143
+ ### Access Raw Response Data
144
+
145
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
146
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
147
+
148
+ ```python
149
+ from yasminaai import YasminaaiApi
150
+
151
+ client = YasminaaiApi(...)
152
+ response = client.quotes.with_raw_response.request_quotes(...)
153
+ print(response.headers) # access the response headers
154
+ print(response.status_code) # access the response status code
155
+ print(response.data) # access the underlying object
156
+ ```
157
+
158
+ ### Retries
159
+
160
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
161
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
162
+ retry limit (default: 2).
163
+
164
+ Which status codes are retried depends on the `retryStatusCodes` generator configuration:
165
+
166
+ **`legacy`** (current default): retries on
167
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
168
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
169
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
170
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
171
+
172
+ **`recommended`**: retries on
173
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
174
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
175
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
176
+ - [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
177
+ - [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
178
+ - [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)
179
+
180
+ Use the `max_retries` request option to configure this behavior.
181
+
182
+ ```python
183
+ client.quotes.request_quotes(..., request_options={
184
+ "max_retries": 1
185
+ })
186
+ ```
187
+
188
+ ### Timeouts
189
+
190
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
191
+
192
+ ```python
193
+ from yasminaai import YasminaaiApi
194
+
195
+ client = YasminaaiApi(..., timeout=20.0)
196
+
197
+ # Override timeout for a specific method
198
+ client.quotes.request_quotes(..., request_options={
199
+ "timeout_in_seconds": 1
200
+ })
201
+ ```
202
+
203
+ ### Custom Client
204
+
205
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
206
+ and transports.
207
+
208
+ ```python
209
+ import httpx
210
+ from yasminaai import YasminaaiApi
211
+
212
+ client = YasminaaiApi(
213
+ ...,
214
+ httpx_client=httpx.Client(
215
+ proxy="http://my.test.proxy.example.com",
216
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
217
+ ),
218
+ )
219
+ ```
220
+
221
+ ## Contributing
222
+
223
+ While we value open-source contributions to this SDK, this library is generated programmatically.
224
+ Additions made directly to this library would have to be moved over to our generation code,
225
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
226
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
227
+ an issue first to discuss with us!
228
+
229
+ On the other hand, contributions to the README are always very welcome!
230
+
@@ -0,0 +1,198 @@
1
+ # Yasminaai Python Library
2
+
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%2FYasminaAI%2Fmotor-python-sdk)
4
+ [![pypi](https://img.shields.io/pypi/v/motor-python-sdk)](https://pypi.python.org/pypi/motor-python-sdk)
5
+
6
+ The Yasminaai Python library provides convenient access to the Yasminaai APIs from Python.
7
+
8
+ ## Table of Contents
9
+
10
+ - [Installation](#installation)
11
+ - [Reference](#reference)
12
+ - [Usage](#usage)
13
+ - [Environments](#environments)
14
+ - [Async Client](#async-client)
15
+ - [Exception Handling](#exception-handling)
16
+ - [Advanced](#advanced)
17
+ - [Access Raw Response Data](#access-raw-response-data)
18
+ - [Retries](#retries)
19
+ - [Timeouts](#timeouts)
20
+ - [Custom Client](#custom-client)
21
+ - [Contributing](#contributing)
22
+
23
+ ## Installation
24
+
25
+ ```sh
26
+ pip install motor-python-sdk
27
+ ```
28
+
29
+ ## Reference
30
+
31
+ A full reference for this library is available [here](https://github.com/YasminaAI/motor-python-sdk/blob/HEAD/./reference.md).
32
+
33
+ ## Usage
34
+
35
+ Instantiate and use the client with the following:
36
+
37
+ ```python
38
+ from yasminaai import YasminaaiApi
39
+ import datetime
40
+
41
+ client = YasminaaiApi(
42
+ token="<token>",
43
+ )
44
+
45
+ client.quotes.request_quotes(
46
+ owner_id="owner_id",
47
+ phone="phone",
48
+ birthdate=datetime.date.fromisoformat("2023-01-15"),
49
+ car_sequence_number="car_sequence_number",
50
+ car_estimated_cost=1.1,
51
+ )
52
+ ```
53
+
54
+ ## Environments
55
+
56
+ This SDK allows you to configure different environments for API requests.
57
+
58
+ ```python
59
+ from yasminaai import YasminaaiApi
60
+ from yasminaai.environment import YasminaaiApiEnvironment
61
+
62
+ client = YasminaaiApi(
63
+ environment=YasminaaiApiEnvironment.DEFAULT,
64
+ )
65
+ ```
66
+
67
+ ## Async Client
68
+
69
+ The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client).
70
+
71
+ ```python
72
+ import asyncio
73
+ import datetime
74
+
75
+ from yasminaai import AsyncYasminaaiApi
76
+
77
+ client = AsyncYasminaaiApi(
78
+ token="<token>",
79
+ )
80
+
81
+
82
+ async def main() -> None:
83
+ await client.quotes.request_quotes(
84
+ owner_id="owner_id",
85
+ phone="phone",
86
+ birthdate=datetime.date.fromisoformat("2023-01-15"),
87
+ car_sequence_number="car_sequence_number",
88
+ car_estimated_cost=1.1,
89
+ )
90
+
91
+
92
+ asyncio.run(main())
93
+ ```
94
+
95
+ ## Exception Handling
96
+
97
+ When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
98
+ will be thrown.
99
+
100
+ ```python
101
+ from yasminaai.core.api_error import ApiError
102
+
103
+ try:
104
+ client.quotes.request_quotes(...)
105
+ except ApiError as e:
106
+ print(e.status_code)
107
+ print(e.body)
108
+ ```
109
+
110
+ ## Advanced
111
+
112
+ ### Access Raw Response Data
113
+
114
+ The SDK provides access to raw response data, including headers, through the `.with_raw_response` property.
115
+ The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes.
116
+
117
+ ```python
118
+ from yasminaai import YasminaaiApi
119
+
120
+ client = YasminaaiApi(...)
121
+ response = client.quotes.with_raw_response.request_quotes(...)
122
+ print(response.headers) # access the response headers
123
+ print(response.status_code) # access the response status code
124
+ print(response.data) # access the underlying object
125
+ ```
126
+
127
+ ### Retries
128
+
129
+ The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
130
+ as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
131
+ retry limit (default: 2).
132
+
133
+ Which status codes are retried depends on the `retryStatusCodes` generator configuration:
134
+
135
+ **`legacy`** (current default): retries on
136
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
137
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
138
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
139
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)
140
+
141
+ **`recommended`**: retries on
142
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
143
+ - [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict)
144
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
145
+ - [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
146
+ - [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
147
+ - [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)
148
+
149
+ Use the `max_retries` request option to configure this behavior.
150
+
151
+ ```python
152
+ client.quotes.request_quotes(..., request_options={
153
+ "max_retries": 1
154
+ })
155
+ ```
156
+
157
+ ### Timeouts
158
+
159
+ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
160
+
161
+ ```python
162
+ from yasminaai import YasminaaiApi
163
+
164
+ client = YasminaaiApi(..., timeout=20.0)
165
+
166
+ # Override timeout for a specific method
167
+ client.quotes.request_quotes(..., request_options={
168
+ "timeout_in_seconds": 1
169
+ })
170
+ ```
171
+
172
+ ### Custom Client
173
+
174
+ You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
175
+ and transports.
176
+
177
+ ```python
178
+ import httpx
179
+ from yasminaai import YasminaaiApi
180
+
181
+ client = YasminaaiApi(
182
+ ...,
183
+ httpx_client=httpx.Client(
184
+ proxy="http://my.test.proxy.example.com",
185
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
186
+ ),
187
+ )
188
+ ```
189
+
190
+ ## Contributing
191
+
192
+ While we value open-source contributions to this SDK, this library is generated programmatically.
193
+ Additions made directly to this library would have to be moved over to our generation code,
194
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
195
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
196
+ an issue first to discuss with us!
197
+
198
+ On the other hand, contributions to the README are always very welcome!
@@ -0,0 +1,97 @@
1
+ [project]
2
+ name = "motor-python-sdk"
3
+ dynamic = ["version"]
4
+
5
+ [tool.poetry]
6
+ name = "motor-python-sdk"
7
+ version = "0.0.2"
8
+ description = ""
9
+ readme = "README.md"
10
+ authors = []
11
+ keywords = []
12
+
13
+ classifiers = [
14
+ "Intended Audience :: Developers",
15
+ "Programming Language :: Python",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Programming Language :: Python :: 3.14",
22
+ "Programming Language :: Python :: 3.15",
23
+ "Operating System :: OS Independent",
24
+ "Operating System :: POSIX",
25
+ "Operating System :: MacOS",
26
+ "Operating System :: POSIX :: Linux",
27
+ "Operating System :: Microsoft :: Windows",
28
+ "Topic :: Software Development :: Libraries :: Python Modules",
29
+ "Typing :: Typed"
30
+ ]
31
+ packages = [
32
+ { include = "yasminaai", from = "src"}
33
+ ]
34
+
35
+ [tool.poetry.urls]
36
+ Repository = 'https://github.com/YasminaAI/motor-python-sdk'
37
+
38
+ [tool.poetry.dependencies]
39
+ python = "^3.10"
40
+ aiohttp = { version = ">=3.14.0,<4", optional = true, python = ">=3.10"}
41
+ httpx = ">=0.21.2"
42
+ httpx-aiohttp = { version = "0.1.8", optional = true, python = ">=3.10"}
43
+ pydantic = ">= 1.9.2"
44
+ pydantic-core = ">=2.18.2,<3.0.0"
45
+ typing_extensions = ">= 4.0.0"
46
+
47
+ [tool.poetry.group.dev.dependencies]
48
+ mypy = "==1.13.0"
49
+ pytest = "^9.0.3"
50
+ pytest-asyncio = "^1.0.0"
51
+ pytest-xdist = "^3.6.1"
52
+ python-dateutil = "^2.9.0"
53
+ types-python-dateutil = "^2.9.0.20240316"
54
+ urllib3 = ">=2.6.3,<3.0.0"
55
+ ruff = "==0.11.5"
56
+
57
+ [tool.pytest.ini_options]
58
+ testpaths = [ "tests" ]
59
+ asyncio_mode = "auto"
60
+ norecursedirs = [ "src" ]
61
+ markers = [
62
+ "aiohttp: tests that require httpx_aiohttp to be installed",
63
+ ]
64
+
65
+ [tool.mypy]
66
+ plugins = ["pydantic.mypy"]
67
+
68
+ [tool.ruff]
69
+ line-length = 120
70
+
71
+ [tool.ruff.lint]
72
+ select = [
73
+ "E", # pycodestyle errors
74
+ "F", # pyflakes
75
+ "I", # isort
76
+ ]
77
+ ignore = [
78
+ "E402", # Module level import not at top of file
79
+ "E501", # Line too long
80
+ "E711", # Comparison to `None` should be `cond is not None`
81
+ "E712", # Avoid equality comparisons to `True`; use `if ...:` checks
82
+ "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks
83
+ "E722", # Do not use bare `except`
84
+ "E731", # Do not assign a `lambda` expression, use a `def`
85
+ "F821", # Undefined name
86
+ "F841" # Local variable ... is assigned to but never used
87
+ ]
88
+
89
+ [tool.ruff.lint.isort]
90
+ section-order = ["future", "standard-library", "third-party", "first-party"]
91
+
92
+ [build-system]
93
+ requires = ["poetry-core"]
94
+ build-backend = "poetry.core.masonry.api"
95
+
96
+ [tool.poetry.extras]
97
+ aiohttp=["aiohttp", "httpx-aiohttp"]
@@ -0,0 +1,113 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ import typing
6
+ from importlib import import_module
7
+
8
+ if typing.TYPE_CHECKING:
9
+ from .types import (
10
+ BadRequestErrorBody,
11
+ Benefit,
12
+ CompanyQuote,
13
+ Error,
14
+ Policy,
15
+ QuotePrice,
16
+ QuoteResponse,
17
+ QuoteResponseDriversItem,
18
+ QuoteResponseQuotesItem,
19
+ UnauthorizedErrorBody,
20
+ )
21
+ from .errors import BadRequestError, NotFoundError, UnauthorizedError, UnprocessableEntityError
22
+ from . import ot_ps, policies, quotes
23
+ from ._default_clients import DefaultAioHttpClient, DefaultAsyncHttpxClient
24
+ from .client import AsyncYasminaaiApi, YasminaaiApi
25
+ from .environment import YasminaaiApiEnvironment
26
+ from .quotes import (
27
+ DeleteQuoteRequestsIdResponse,
28
+ GetQuoteRequestsResponse,
29
+ GetQuoteRequestsResponseLinksItem,
30
+ PostQuoteRequestsRequestDriversItem,
31
+ )
32
+ from .version import __version__
33
+ _dynamic_imports: typing.Dict[str, str] = {
34
+ "AsyncYasminaaiApi": ".client",
35
+ "BadRequestError": ".errors",
36
+ "BadRequestErrorBody": ".types",
37
+ "Benefit": ".types",
38
+ "CompanyQuote": ".types",
39
+ "DefaultAioHttpClient": "._default_clients",
40
+ "DefaultAsyncHttpxClient": "._default_clients",
41
+ "DeleteQuoteRequestsIdResponse": ".quotes",
42
+ "Error": ".types",
43
+ "GetQuoteRequestsResponse": ".quotes",
44
+ "GetQuoteRequestsResponseLinksItem": ".quotes",
45
+ "NotFoundError": ".errors",
46
+ "Policy": ".types",
47
+ "PostQuoteRequestsRequestDriversItem": ".quotes",
48
+ "QuotePrice": ".types",
49
+ "QuoteResponse": ".types",
50
+ "QuoteResponseDriversItem": ".types",
51
+ "QuoteResponseQuotesItem": ".types",
52
+ "UnauthorizedError": ".errors",
53
+ "UnauthorizedErrorBody": ".types",
54
+ "UnprocessableEntityError": ".errors",
55
+ "YasminaaiApi": ".client",
56
+ "YasminaaiApiEnvironment": ".environment",
57
+ "__version__": ".version",
58
+ "ot_ps": ".ot_ps",
59
+ "policies": ".policies",
60
+ "quotes": ".quotes",
61
+ }
62
+
63
+
64
+ def __getattr__(attr_name: str) -> typing.Any:
65
+ module_name = _dynamic_imports.get(attr_name)
66
+ if module_name is None:
67
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
68
+ try:
69
+ module = import_module(module_name, __package__)
70
+ if module_name == f".{attr_name}":
71
+ return module
72
+ else:
73
+ return getattr(module, attr_name)
74
+ except ImportError as e:
75
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
76
+ except AttributeError as e:
77
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
78
+
79
+
80
+ def __dir__():
81
+ lazy_attrs = list(_dynamic_imports.keys())
82
+ return sorted(lazy_attrs)
83
+
84
+
85
+ __all__ = [
86
+ "AsyncYasminaaiApi",
87
+ "BadRequestError",
88
+ "BadRequestErrorBody",
89
+ "Benefit",
90
+ "CompanyQuote",
91
+ "DefaultAioHttpClient",
92
+ "DefaultAsyncHttpxClient",
93
+ "DeleteQuoteRequestsIdResponse",
94
+ "Error",
95
+ "GetQuoteRequestsResponse",
96
+ "GetQuoteRequestsResponseLinksItem",
97
+ "NotFoundError",
98
+ "Policy",
99
+ "PostQuoteRequestsRequestDriversItem",
100
+ "QuotePrice",
101
+ "QuoteResponse",
102
+ "QuoteResponseDriversItem",
103
+ "QuoteResponseQuotesItem",
104
+ "UnauthorizedError",
105
+ "UnauthorizedErrorBody",
106
+ "UnprocessableEntityError",
107
+ "YasminaaiApi",
108
+ "YasminaaiApiEnvironment",
109
+ "__version__",
110
+ "ot_ps",
111
+ "policies",
112
+ "quotes",
113
+ ]
@@ -0,0 +1,32 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import httpx
6
+
7
+ SDK_DEFAULT_TIMEOUT = 60
8
+
9
+ try:
10
+ import httpx_aiohttp # type: ignore[import-not-found]
11
+ except ImportError:
12
+
13
+ class DefaultAioHttpClient(httpx.AsyncClient): # type: ignore
14
+ def __init__(self, **kwargs: typing.Any) -> None:
15
+ raise RuntimeError(
16
+ "To use the aiohttp client, install the aiohttp extra: pip install motor-python-sdk[aiohttp]"
17
+ )
18
+
19
+ else:
20
+
21
+ class DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore
22
+ def __init__(self, **kwargs: typing.Any) -> None:
23
+ kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
24
+ kwargs.setdefault("follow_redirects", True)
25
+ super().__init__(**kwargs)
26
+
27
+
28
+ class DefaultAsyncHttpxClient(httpx.AsyncClient):
29
+ def __init__(self, **kwargs: typing.Any) -> None:
30
+ kwargs.setdefault("timeout", SDK_DEFAULT_TIMEOUT)
31
+ kwargs.setdefault("follow_redirects", True)
32
+ super().__init__(**kwargs)