Skip to main content

Python SDK for the SendKit email API

Project description

SendKit Python SDK

Official Python SDK for the SendKit email API.

Installation

pip install sendkit

Usage

Create a Client

from sendkit import SendKit

client = SendKit("sk_your_api_key")

Send an Email

result = client.emails.send(
    from_="you@example.com",
    to="recipient@example.com",
    subject="Hello from SendKit",
    html="<h1>Welcome!</h1>",
)

print(result["id"])

Send a MIME Email

result = client.emails.send_mime(
    envelope_from="you@example.com",
    envelope_to="recipient@example.com",
    raw_message=mime_string,
)

Error Handling

API errors raise SendKitError:

from sendkit import SendKit, SendKitError

client = SendKit("sk_your_api_key")

try:
    client.emails.send(...)
except SendKitError as e:
    print(e.name)        # e.g. "validation_error"
    print(e.message)     # e.g. "The to field is required."
    print(e.status_code) # e.g. 422

Configuration

# Read API key from SENDKIT_API_KEY environment variable
client = SendKit()

# Custom base URL
client = SendKit("sk_...", base_url="https://custom.api.com")

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

sendkit-1.0.7.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sendkit-1.0.7-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file sendkit-1.0.7.tar.gz.

File metadata

  • Download URL: sendkit-1.0.7.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sendkit-1.0.7.tar.gz
Algorithm Hash digest
SHA256 c90d855e5db0eef810c2b66f1727a0afb6d0f086b5d9f07262b6b37035f338a5
MD5 0d7bfe74ed9d83ecdbaff5371d91f8c5
BLAKE2b-256 873935d7b1e9e6bab4fb392d928697bbf031f6f2c9a93f245e61b9b37c1cb9ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for sendkit-1.0.7.tar.gz:

Publisher: tests.yml on sendkitdev/sendkit-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sendkit-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: sendkit-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sendkit-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 78456722473825f0fa3da3b9ecc8168c24dce75ab7028064486504f3085f41b1
MD5 0d6369e970cb868cc1a5a1d947d48fa4
BLAKE2b-256 9f12f1a8b1dde9ed194531ca784f8520be5ffa71ed1db4b54d26969e5e28f509

See more details on using hashes here.

Provenance

The following attestation bundles were made for sendkit-1.0.7-py3-none-any.whl:

Publisher: tests.yml on sendkitdev/sendkit-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page