Generated Python client for the Sendmux Sending API.
Project description
sendmux-sending
Generated Python client for the Sendmux Sending API.
Documentation
- Sending API reference: sendmux.ai/docs/sending-api/introduction
- Source repository: Sendmux/sendmux-sdk
Requirements
- Python 3.10 or newer.
- A send-capable
smx_mbx_*key or owner-approved Sending-resourcesmx_agent_*token.
Installation
pip install sendmux-sending
Usage
import os
from sendmux_sending import Address, EmailSendRequest, EmailsApi, create_sending_client
client = create_sending_client(api_key=os.environ["SENDMUX_SENDING_API_KEY"])
api = EmailsApi(client)
response = api.sending_send_email(
EmailSendRequest(
var_from=Address(email="sender@example.com"),
to=Address(email="recipient@example.com"),
subject="Hello from Sendmux",
html_body="<p>Hello.</p>",
text_body="Hello.",
),
idempotency_key="email_123",
)
print(response.data.message_id)
The package exports every generated Sending model and API class plus:
create_sending_clientconfigure_sendingSendmuxSendingApiClient- file helpers:
upload_attachment_from_file,send_email_with_files, and explicit legacyattachment_from_file
Attachments
For real files, upload bytes first and send with returned attachment_id refs. send_email_with_files does that automatically, so file bytes never enter model context or the JSON send body. Inline base64 remains available only when you intentionally call attachment_from_file for tiny generated content.
import os
from sendmux_sending import create_sending_client, send_email_with_files
client = create_sending_client(api_key=os.environ["SENDMUX_SENDING_API_KEY"])
send_email_with_files(
client,
files=["./report.pdf"],
idempotency_key="report-123",
body={
"from": {"email": "sender@example.com"},
"to": {"email": "recipient@example.com"},
"subject": "Report",
"html_body": "<p>Attached.</p>",
},
)
To upload first and compose the send yourself:
import os
from sendmux_sending import EmailSendRequest, EmailsApi, create_sending_client, upload_attachment_from_file
client = create_sending_client(api_key=os.environ["SENDMUX_SENDING_API_KEY"])
attachment = upload_attachment_from_file(client, file_path="./report.pdf")
EmailsApi(client).sending_send_email(
EmailSendRequest.from_dict({
"from": {"email": "sender@example.com"},
"to": {"email": "recipient@example.com"},
"subject": "Report",
"html_body": "<p>Attached.</p>",
"attachments": [{"attachment_id": attachment.data.attachment_id}],
})
)
Request helpers
Use sendmux-core when you need explicit idempotency, conditional request, pagination, retry, or typed-error helpers. The generated Sending client already uses the shared retry and error mapper.
Support
Open an issue in Sendmux/sendmux-sdk with the package name, version, and request ID from any API error.
Licence
MIT. See the licence file.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sendmux_sending-1.3.0.tar.gz.
File metadata
- Download URL: sendmux_sending-1.3.0.tar.gz
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c5cf5a17c46d0e3274a82942fcd6f739c8beb2f0c547e516654c4c8dc232385
|
|
| MD5 |
9eee988ddfd9d919fc6225cfa353f177
|
|
| BLAKE2b-256 |
029eeb0c107d7b2ec0c1cc19cd20648cb031275e518a15cf3519faaa0246e3fe
|
Provenance
The following attestation bundles were made for sendmux_sending-1.3.0.tar.gz:
Publisher:
release-please.yml on Sendmux/sendmux-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sendmux_sending-1.3.0.tar.gz -
Subject digest:
2c5cf5a17c46d0e3274a82942fcd6f739c8beb2f0c547e516654c4c8dc232385 - Sigstore transparency entry: 2112295384
- Sigstore integration time:
-
Permalink:
Sendmux/sendmux-sdk@669cdc71b3bd4f023b29aa39310fb93d0d157dba -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Sendmux
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@669cdc71b3bd4f023b29aa39310fb93d0d157dba -
Trigger Event:
push
-
Statement type:
File details
Details for the file sendmux_sending-1.3.0-py3-none-any.whl.
File metadata
- Download URL: sendmux_sending-1.3.0-py3-none-any.whl
- Upload date:
- Size: 70.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
354fbd16e1aec38fe3149276516308c691b1292aeaf32059b48600bda3ff271f
|
|
| MD5 |
c16fac5a5c90b801ea8280a239b68bc4
|
|
| BLAKE2b-256 |
827747d999577ec5bf73c92c8ab1f4c9e1a42451434500935f3e4d95948f0209
|
Provenance
The following attestation bundles were made for sendmux_sending-1.3.0-py3-none-any.whl:
Publisher:
release-please.yml on Sendmux/sendmux-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sendmux_sending-1.3.0-py3-none-any.whl -
Subject digest:
354fbd16e1aec38fe3149276516308c691b1292aeaf32059b48600bda3ff271f - Sigstore transparency entry: 2112295406
- Sigstore integration time:
-
Permalink:
Sendmux/sendmux-sdk@669cdc71b3bd4f023b29aa39310fb93d0d157dba -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Sendmux
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@669cdc71b3bd4f023b29aa39310fb93d0d157dba -
Trigger Event:
push
-
Statement type: