Skip to main content

Codemail para Python

pip install codemail-sdk
from codemail import Codemail, Attachment

cm = Codemail("cm_live_...")            # ou defina CODEMAIL_API_KEY

r = cm.emails.send(
    from_="alerta@meudominio.com.br",   # precisa ser do domínio da chave
    to="ana@cliente.com",               # um endereço ou uma lista
    subject="Seu pedido foi enviado",
    html="<p>Olá!</p>",
    attachments=[Attachment.from_file("nota.pdf")],
)
print(r.id, r.status)                    # status: queued (o envio é assíncrono)

cm.emails.get(r.id).status               # queued, sent, delivered, bounced...
cm.emails.events(r.id)                   # linha do tempo
cm.emails.list(status="bounced", limit=20)
  • Idempotente por padrão: cada send leva um Idempotency-Key e o repete nas retentativas, então um timeout nunca vira dois e-mails. Passe idempotency_key="..." para controlar você mesmo.
  • Retentativas: erro de rede, 429 (respeita Retry-After) e 5xx, até max_retries (padrão 2).
  • Erros tipados: AuthenticationError, PermissionDeniedError, NotFoundError, InvalidRequestError (param diz o campo), RateLimitError (retry_after), ServerError, APIConnectionError.
  • Sem dependências. Python 3.9+.

Metadata

Release files for codemail-sdk 0.1.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 codemail-sdk 0.1.0
File Size Uploaded Provenance
codemail_sdk-0.1.0.tar.gz 7.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for codemail-sdk 0.1.0
File Interpreter ABI Platform
codemail_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / codemail_sdk-0.1.0.tar.gz

Download URL codemail_sdk-0.1.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0d2cbcda8f5904da489702622938ad8cfe0f9050ccd4fd3600ba02a6bf623d3a
BLAKE2b-256 checksum
How to use checksums
0c283effd4ebb9d9fcd2cfbab81c048f99454573e985ff08d4cad40b4d981cbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / codemail_sdk-0.1.0-py3-none-any.whl

Download URL codemail_sdk-0.1.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b33df0cf76beb8b96abcb87c96620fe1e10b17caf70c3450dcd396442c1230d2
BLAKE2b-256 checksum
How to use checksums
f5d43ba76fc1a8292fccfaa822cebb0addaf171e8933fa77f7a690abb59f622a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for codemail-sdk 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.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