Skip to main content

SendHog Python SDK

Send transactional email through SendHog with a domain-scoped API key. Native API plus SES-, Postmark-, Resend- and SendGrid-shaped migration clients, all using SendHog authentication and the same transport.

Python 3.11+. MIT licensed. Registry publication status is recorded in GitHub Releases; do not assume a version exists on PyPI until it is listed there as published.

Install

pip install sendhog-sdk

Before the first registry release, install the public source instead: pip install git+https://github.com/SendHog/sdk-python.git.

Send

import os
from sendhog import SendHog

client = SendHog(os.environ['SENDHOG_API_KEY'])
message = client.send({
    'from': 'hello@your-verified-domain.com',
    'to': 'recipient@example.com',
    'subject': 'Welcome',
    'html': '<h1>Welcome</h1>',
    'text': 'Welcome',
})
print(message['id'])

Your domain must be verified and approved for sending. Account allowances, recipient suppressions and other server-side controls still apply. Store API keys in your server's secret manager, not in source code.

Published templates

client.send({
    'from': 'hello@your-verified-domain.com',
    'to': 'recipient@example.com',
    'template': {'id': 'welcome', 'version': 1, 'variables': {'name': 'Alex'}},
})

IDs/slugs belong to your sending domain; omit version for latest published. Template and inline html/text are mutually exclusive. HTML variables are escaped; missing variables fail before dispatch. No arbitrary JSX or JavaScript execution.

Read retained mail

page = client.messages.list({'limit': 20})
detail = client.messages.get(page['data'][0]['id'])

Requires email.read. This is a SendHog extension, not provider inbox/API emulation. No automatic send retries; inspect failures before resubmitting an email.

Migration modules

Module Supported method
sendhog.ses SESv2Client.send_email(**input)
sendhog.postmark async ServerClient.outbound.send(input)
sendhog.resend Resend.Emails.send(input)
sendhog.sendgrid SendGridAPIClient.send(input)

All use SendHog API keys/endpoints, not upstream credentials or SigV4. Supported subset: text/HTML, up to 50 total recipients, cc/bcc/reply-to (native reply_to); native/Resend-style requests also support published SendHog templates. No raw MIME, attachments, batch, scheduling, tracking or complete upstream SDK compatibility. Documentation.

Source and development

This is a reproducible release mirror of SendHog's canonical SDK source, not an independently maintained API fork. SOURCE.json records the exact source revision, contract hash and exported file digests. Public contract/ fixtures are synthetic; no service source, account data or credentials are exported. File issues here; maintainers update the canonical generator/runtime and re-export the release.

python -m pip install . build twine
python scripts/verify-source.py
python -m unittest discover -s tests -p '*_test.py'
python -m build
python -m twine check dist/*

CI runs on pushes/PRs. The manual publish.yml workflow publishes a matching vX.Y.Z tag with PyPI trusted publishing in the pypi GitHub environment. An authorized PyPI account must first configure the pending/existing publisher for sendhog-sdk, SendHog/sdk-python, workflow publish.yml, environment pypi. No token is stored here.

Metadata

Release files for sendhog-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 sendhog-sdk 0.1.0
File Size Uploaded
sendhog_sdk-0.1.0.tar.gz 16.3 kB Details

Built distribution (wheel)

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

Total release size: 32.1 kB

Release files / sendhog_sdk-0.1.0.tar.gz

Download URL sendhog_sdk-0.1.0.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e410d908e1a52871dee73e64978c5df86a5d7dc337479ae7e9fc95dc7d837588
BLAKE2b-256 checksum
How to use checksums
bb9aaf7f8038bf8d1d4d9709c2ec885c32f317a4760e57e9d27e2f3b3433a938
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

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

Download URL sendhog_sdk-0.1.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66e48f07f4061eb73813d048861f67276b1fe5f57df046e24321c8a36c3526a3
BLAKE2b-256 checksum
How to use checksums
dcb7e0dc7160df3ed46839bd0965d6386158354539909594e83444b45c103a38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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