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.6.tar.gz (6.0 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.6-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sendkit-1.0.6.tar.gz
  • Upload date:
  • Size: 6.0 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.6.tar.gz
Algorithm Hash digest
SHA256 c3befaf3c0e08c3df9719d48daa1740817c412f5603375f4d65140346b41aed0
MD5 a54ef4cc64734cb013fbd0df9cdc87ad
BLAKE2b-256 cc8d6bf6f6ef95cf92dc4155f253e8630de23d16dd477e81b4070932fb607bc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for sendkit-1.0.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: sendkit-1.0.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d76a9e6ba095e861789328b4a517e5299bb77be847bae4dd08fd7c75ff5bc433
MD5 b362975ffca3eda7eb121542957dffe8
BLAKE2b-256 63dd350499d91b762e11c3a3ced424cfaaa11e79e0c143ea1c242902cfd4053b

See more details on using hashes here.

Provenance

The following attestation bundles were made for sendkit-1.0.6-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