You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Sent Dm Python library provides convenient access to the Sent Dm REST API from any Python 3.9+
6
+
The Sent Python library provides convenient access to the Sent REST API from any Python 3.9+
7
7
application. The library includes type definitions for all request params and response fields,
8
8
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
9
9
10
10
It is generated with [Stainless](https://www.stainless.com/).
11
11
12
12
## MCP Server
13
13
14
-
Use the Sent Dm MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
14
+
Use the Sent MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
15
15
16
16
[](https://cursor.com/en-US/install-mcp?name=%40sentdm%2Fsentdm-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBzZW50ZG0vc2VudGRtLW1jcCJdLCJlbnYiOnsiU0VOVF9ETV9BUElfS0VZIjoiTXkgQVBJIEtleSJ9fQ)
17
17
[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40sentdm%2Fsentdm-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40sentdm%2Fsentdm-mcp%22%5D%2C%22env%22%3A%7B%22SENT_DM_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)
@@ -35,9 +35,9 @@ The full API of this library can be found in [api.md](api.md).
35
35
36
36
```python
37
37
import os
38
-
from sent_dm importSentDm
38
+
from sent_dm importSent
39
39
40
-
client =SentDm(
40
+
client =Sent(
41
41
api_key=os.environ.get("SENT_DM_API_KEY"), # This is the default and can be omitted
42
42
)
43
43
@@ -63,14 +63,14 @@ so that your API Key is not stored in source control.
63
63
64
64
## Async usage
65
65
66
-
Simply import `AsyncSentDm` instead of `SentDm` and use `await` with each API call:
66
+
Simply import `AsyncSent` instead of `Sent` and use `await` with each API call:
67
67
68
68
```python
69
69
import os
70
70
import asyncio
71
-
from sent_dm importAsyncSentDm
71
+
from sent_dm importAsyncSent
72
72
73
-
client =AsyncSentDm(
73
+
client =AsyncSent(
74
74
api_key=os.environ.get("SENT_DM_API_KEY"), # This is the default and can be omitted
75
75
)
76
76
@@ -113,11 +113,11 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
113
113
import os
114
114
import asyncio
115
115
from sent_dm import DefaultAioHttpClient
116
-
from sent_dm importAsyncSentDm
116
+
from sent_dm importAsyncSent
117
117
118
118
119
119
asyncdefmain() -> None:
120
-
asyncwithAsyncSentDm(
120
+
asyncwithAsyncSent(
121
121
api_key=os.environ.get("SENT_DM_API_KEY"), # This is the default and can be omitted
122
122
http_client=DefaultAioHttpClient(),
123
123
) as client:
@@ -153,9 +153,9 @@ Typed requests and responses provide autocomplete and documentation within your
153
153
Nested parameters are dictionaries, typed using `TypedDict`, for example:
154
154
155
155
```python
156
-
from sent_dm importSentDm
156
+
from sent_dm importSent
157
157
158
-
client =SentDm()
158
+
client =Sent()
159
159
160
160
response = client.messages.send(
161
161
template={
@@ -181,9 +181,9 @@ All errors inherit from `sent_dm.APIError`.
181
181
182
182
```python
183
183
import sent_dm
184
-
from sent_dm importSentDm
184
+
from sent_dm importSent
185
185
186
-
client =SentDm()
186
+
client =Sent()
187
187
188
188
try:
189
189
client.messages.send(
@@ -231,10 +231,10 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
231
231
You can use the `max_retries` option to configure or disable retry settings:
232
232
233
233
```python
234
-
from sent_dm importSentDm
234
+
from sent_dm importSent
235
235
236
236
# Configure the default for all requests:
237
-
client =SentDm(
237
+
client =Sent(
238
238
# default is 2
239
239
max_retries=0,
240
240
)
@@ -260,16 +260,16 @@ By default requests time out after 1 minute. You can configure this with a `time
260
260
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
0 commit comments