Skip to main content

SendCraft Python SDK

Official Python SDK for SendCraft — send transactional emails and campaigns via the SendCraft API.

Installation

pip install sendcraft-sdk

Quick Start

import os
from sendcraft import SendCraft

client = SendCraft(api_key=os.environ["SENDCRAFT_API_KEY"])

result = client.send_email(
    to_email="user@example.com",
    subject="Hello from SendCraft",
    html_content="<h1>Hello!</h1><p>Welcome!</p>",
    from_email="noreply@yourdomain.com"
)

print(result)

Environment Variables

SENDCRAFT_API_KEY=sk_live_your_key_here

Usage Examples

Send Bulk Emails

client.send_bulk_emails(
    emails=[
        {"toEmail": "user1@example.com", "toName": "John"},
        {"toEmail": "user2@example.com", "toName": "Jane"},
    ],
    subject="Weekly Newsletter",
    html_content="<h1>This week...</h1>",
    from_email="newsletter@yourdomain.com"
)

Create Campaign

client.create_campaign(
    name="Product Launch",
    subject="Big News!",
    html_content="<h1>Check it out!</h1>",
    from_email="marketing@yourdomain.com",
    recipients=["user1@example.com", "user2@example.com"]
)

Error Handling

from sendcraft import SendCraft, SendCraftError, UnauthorizedError, RateLimitError

try:
    client.send_email(...)
except UnauthorizedError:
    print("Invalid API key")
except RateLimitError:
    print("Too many requests")
except SendCraftError as e:
    print("Error:", e)

API Reference

Method Description
send_email(...) Send a single email
send_bulk_emails(...) Send to multiple recipients
schedule_email(...) Schedule email for later
get_email_stats() Get email statistics
create_campaign(...) Create campaign
get_campaigns(limit) List campaigns
send_campaign(id) Send campaign
create_template(...) Create template
get_templates() List templates
create_webhook(...) Create webhook
get_analytics(id) Campaign analytics
get_account() Account info

Support

License

MIT

Metadata

Release files for sendcraft-sdk 1.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 sendcraft-sdk 1.1.0
File Size Uploaded Provenance
sendcraft_sdk-1.1.0.tar.gz 4.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sendcraft-sdk 1.1.0
File Interpreter ABI Platform
sendcraft_sdk-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.0 kB

Release files / sendcraft_sdk-1.1.0.tar.gz

Download URL sendcraft_sdk-1.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
05769abf0d1fd8599bcfcf8f7c9ba5f00f3c6481e6fe9ac3b86e46a7324f867f
BLAKE2b-256 checksum
How to use checksums
589c6c434a2ce41cf8597b6f81aed17441c0db5b75676caf0874743a99657a5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sendcraft_sdk-1.1.0-py3-none-any.whl

Download URL sendcraft_sdk-1.1.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c803d83e8ea3219256ac2fd333f08d12bdfca8439a975ea467d182a7b42f1d5c
BLAKE2b-256 checksum
How to use checksums
5c57240cc2683da826483fc327e1122fd759ce88248bf7484d6ed9f08382f4f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for sendcraft-sdk 1.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.

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

Release history Release notifications | RSS feed

This release

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