Skip to main content

qubrics-sending

PyPI version Python versions PyPI downloads Licence

Generated Python client for the Qubrics Sending API.

Documentation

Requirements

  • Python 3.10 or newer.
  • A send-capable smx_mbx_* key or owner-approved Sending-resource smx_agent_* token.

For OAuth, use a REST access token with the scopes and mailbox access required by the operation. See OAuth for REST APIs.

Installation

These commands target the Qubrics release of qubrics-sending. Until it is published, install sendmux-sending with its existing import names.

pip install qubrics-sending

Connection checks

Check the authenticated team and credential without sending an email:

import os

from qubrics.sending import MetaApi, create_sending_client

with create_sending_client(api_key=os.environ["QUBRICS_SENDING_API_KEY"]) as client:
    connection = MetaApi(client).sending_get_connection()
    print(connection.data.label)

OAuth access tokens

Pass either api_key or access_token. access_token accepts a bare token string or a synchronous callable; the callable is evaluated for each authenticated request. Your application owns token storage, expiry checks and refresh coordination.

import os

from qubrics.sending import create_sending_client

client = create_sending_client(
    access_token=lambda: os.environ["QUBRICS_ACCESS_TOKEN"]
)

Usage

import os

from qubrics.sending import Address, EmailSendRequest, EmailsApi, create_sending_client

client = create_sending_client(api_key=os.environ["QUBRICS_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 Qubrics",
        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_client
  • configure_sending
  • QubricsSendingApiClient
  • file helpers: upload_attachment_from_file, send_email_with_files, and explicit legacy attachment_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 qubrics.sending import create_sending_client, send_email_with_files

client = create_sending_client(api_key=os.environ["QUBRICS_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 qubrics.sending import EmailSendRequest, EmailsApi, create_sending_client, upload_attachment_from_file

client = create_sending_client(api_key=os.environ["QUBRICS_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 qubrics-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 qubrics/qubrics-sdk with the package name, version, and request ID from any API error.

Licence

MIT. See the licence file.

Metadata

Release files for qubrics-sending 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qubrics-sending 2.0.0
File Size Uploaded Provenance Actions
qubrics_sending-2.0.0.tar.gz 38.7 kB Without provenance Details for qubrics_sending-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qubrics-sending 2.0.0
File Interpreter ABI Platform Actions
qubrics_sending-2.0.0-py3-none-any.whl Python 3 none any Details for qubrics_sending-2.0.0-py3-none-any.whl

Total release size: 121.4 kB

Release files / qubrics_sending-2.0.0.tar.gz

Download URL qubrics_sending-2.0.0.tar.gz
Size 38.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bec81fab5ef6b5c98234233ec4ced2b639a17810707dcee3900bb8dbb5a73cd7
BLAKE2b-256 checksum
How to use checksums
af9b859ec9d4f3f6e4344f374031531d97a6a6f7947d79529d9a58094781fde1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release files / qubrics_sending-2.0.0-py3-none-any.whl

Download URL qubrics_sending-2.0.0-py3-none-any.whl
Size 82.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0bfe8844cd006f9f10f6012b8a69bc2d5334a6056bbff86bce65ed94ae876a0a
BLAKE2b-256 checksum
How to use checksums
dc14f1944bbfc721e8e9118c28be614f106b0f7a6c6b59415ee29a34fcc4ad7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Security for qubrics-sending 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page