VibeMail SDK for Python
Official SDK for the VibeMail transactional email API. Python 3.9+, standard library only — installing it pulls in nothing else.
pip install vibemail
Send an email
import os
from vibemail import VibeMail
vibemail = VibeMail(os.environ["VIBEMAIL_API_KEY"])
result = vibemail.send(
from_address="hello@yourdomain.com",
to="ada@example.com",
subject="Welcome",
html="<p>Glad you're here.</p>",
text="Glad you're here.",
)
print(result["id"])
send() returns once the API has accepted the message, not once it has been delivered. Use get(id) to follow it.
Always send a text alternative alongside html. Mail with no plain-text part is measurably more likely to be spam-foldered.
from is a reserved word in Python, so the argument is spelled from_address; it goes out as from on the wire.
Recipients
One message goes to one recipient. To reach several people, use batch() — it sends a separate message to each, which is also what stops your recipients from seeing one another's addresses:
result = vibemail.batch([
{"to": "ada@example.com", "subject": "Welcome", "text": "Hi Ada"},
{"to": "alan@example.com", "subject": "Welcome", "text": "Hi Alan"},
])
for entry in result["data"]:
if "error" in entry:
print("rejected:", entry["error"])
Each entry succeeds or fails on its own; one bad address does not sink the rest.
Passing several addresses to to raises ValueError rather than quietly sending to the first.
Retries and idempotency
Pass idempotency_key on anything you might retry. A repeat carrying the same key returns the original result instead of sending a second copy — which matters because a client that times out has no way of knowing whether the message went out.
vibemail.send(
to="ada@example.com",
subject="Receipt",
text="Thanks!",
idempotency_key=f"receipt-{order_id}",
)
The client retries 429 and 5xx responses on its own (twice by default, honouring Retry-After) and never retries a request the server rejected on its merits. Pass max_retries=0 to handle that yourself.
Scheduling
from datetime import datetime, timedelta, timezone
result = vibemail.send(
to="ada@example.com",
subject="Reminder",
text="Standup in 15 minutes.",
scheduled_at=datetime.now(timezone.utc) + timedelta(hours=2), # or "in 2 hours"
)
vibemail.cancel(result["id"]) # while it is still scheduled
Up to 30 days ahead. A naive datetime is read as UTC rather than as the server's local time. Once the dispatcher has claimed a message it is on its way out and can no longer be withdrawn.
Templates
templates = vibemail.list_templates()
vibemail.send(
to="ada@example.com",
template="welcome",
variables={"name": "Ada"},
)
Anything you pass explicitly — subject, html, text — overrides the stored template, so you can vary one part without redefining the rest.
Errors
from vibemail import VibeMailError, VibeMailTimeoutError
try:
vibemail.send(to="ada@example.com", subject="Hi", text="...")
except VibeMailError as err:
print(err.status, err.detail) # 422 "'to' and 'subject' are required"
if err.is_retryable: # 429 or 5xx
...
except VibeMailTimeoutError:
... # exceeded `timeout`, default 30s
Options
| Argument | Default | |
|---|---|---|
api_key |
— | Required, positional. |
base_url |
https://vibemail.ai |
Point at a self-hosted deployment. |
timeout |
30.0 |
Per-request, in seconds. |
max_retries |
2 |
Applies to 429 and 5xx only. |
API
send(**kwargs) |
Send one message. |
batch(emails, idempotency_key=None) |
Send many, one recipient each. |
get(email_id) |
Status of a send. |
cancel(email_id) |
Withdraw a scheduled send. |
list_templates() |
Stored templates. |
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vibemail-1.0.0.tar.gz.
File metadata
- Download URL: vibemail-1.0.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c40d7f37086a0fdcbafd812113547fc92cbb9a1a85053109d385cf9b2de94f48
|
|
| MD5 |
e14f46635aa0a8a6a94c696fb92b4380
|
|
| BLAKE2b-256 |
f56576ff5266bffe8020f7f87352289647fa960ad4b3a5570d5b487e520f7bdd
|
Provenance
The following attestation bundles were made for vibemail-1.0.0.tar.gz:
Publisher:
publish.yml on vibemailai/vibemail-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vibemail-1.0.0.tar.gz -
Subject digest:
c40d7f37086a0fdcbafd812113547fc92cbb9a1a85053109d385cf9b2de94f48 - Sigstore transparency entry: 2268919891
- Sigstore integration time:
-
Permalink:
vibemailai/vibemail-python@2f7f94dc91bcbb3abeef2617586b7b211ff21b7c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/vibemailai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2f7f94dc91bcbb3abeef2617586b7b211ff21b7c -
Trigger Event:
push
-
Statement type:
File details
Details for the file vibemail-1.0.0-py3-none-any.whl.
File metadata
- Download URL: vibemail-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43f9ac35dcdee72cf7e8dbfbf4a43e28a63c8a7a470f00a35f756e51f7babd54
|
|
| MD5 |
a48f1edfab5681e0736d3493131d2c95
|
|
| BLAKE2b-256 |
a3998fbcb14c7f7e1fb33827acd132a3b56093905a26f8da0802ed3987dafc70
|
Provenance
The following attestation bundles were made for vibemail-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on vibemailai/vibemail-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vibemail-1.0.0-py3-none-any.whl -
Subject digest:
43f9ac35dcdee72cf7e8dbfbf4a43e28a63c8a7a470f00a35f756e51f7babd54 - Sigstore transparency entry: 2268920057
- Sigstore integration time:
-
Permalink:
vibemailai/vibemail-python@2f7f94dc91bcbb3abeef2617586b7b211ff21b7c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/vibemailai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2f7f94dc91bcbb3abeef2617586b7b211ff21b7c -
Trigger Event:
push
-
Statement type: