Autosend Python SDK
Lightweight Python client for the Autosend API. This SDK provides a thin, well documented wrapper around Autosend's HTTP endpoints for managing contacts and sending emails.
Features
- Easy authentication with an API key
- Contact management: create, upsert, remove, search, bulk update, delete
- Sending: transactional single sends and bulk sends with template/dynamic data support
- Input validation and clear, typed exceptions
Installation
Install from source (recommended for development):
pip install -e .
Install directly from GitHub (replace with the repository owner if published):
pip install git+https://github.com/shreyap2702/autosend-python-sdk.git
Install from PyPI
pip install autosend-shreya-sdk
Notes:
- The project uses
requestsfor HTTP; it will be installed automatically frompyproject.toml.
Quickstart
- Create a client with your API key.
from autosend.client import AutosendClient
client = AutosendClient(api_key="YOUR_API_KEY")
- Use resource helpers to manage contacts or send emails.
# Contacts
client.contacts.create_contact(
email="jane.doe@example.com",
first_name="Jane",
last_name="Doe",
user_id="user_123",
custom_fields={"company": "Acme"}
)
# Sending a single transactional email
client.sending.send_email(
to_email="jane.doe@example.com",
to_name="Jane Doe",
from_email="noreply@company.com",
from_name="Company",
subject="Welcome!",
html="<h1>Hello {{name}}</h1>",
dynamic_data={"name": "Jane"}
)
Contact API examples
- Create contact:
client.contacts.create_contact(...) - Upsert contact:
client.contacts.upsert_contact(...)(creates or updates by email) - Remove contacts:
client.contacts.remove_contacts([emails]) - Get contact:
client.contacts.get_contact(contact_id) - Search by emails:
client.contacts.search_by_emails([emails]) - Bulk update:
client.contacts.bulk_update(contacts_list, run_workflow=False) - Delete by user ID:
client.contacts.delete_by_user_id(user_id) - Delete by contact ID:
client.contacts.delete_by_id(contact_id)
Refer to the docstrings in autosend/resources/contacts.py for parameter details and examples.
Sending API examples
- Send a single email:
client.sending.send_email(...)— supports attachments, reply-to, unsubscribe options, and template dynamic data. - Send bulk emails:
client.sending.send_bulk(recipients=..., ...)— up to 100 recipients per request.
Refer to autosend/resources/sending.py for payload and validation rules.
Configuration
- api_key (required): pass to
AutosendClient(api_key=...) - base_url (optional): pass
base_url="https://api.autosend.com/v1"to target a custom endpoint or mock server.
Error handling
The SDK raises typed exceptions from autosend.errors:
AutosendError— base class for SDK errorsAuthenticationError— invalid or missing API key (401)RequestError— network or request-level failuresValidationError— invalid input/arguments
Example:
from autosend.client import AutosendClient
from autosend.errors import AutosendError, ValidationError
client = AutosendClient(api_key="YOUR_API_KEY")
try:
client.contacts.create_contact(email="bad-email", first_name="", last_name="")
except ValidationError as e:
print("Validation failed:", e)
except AutosendError as e:
print("Autosend API error:", e)
Metadata
Release files for autosend-shreya-sdk 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| autosend_shreya_sdk-2.0.0.tar.gz | 13.8 kB | Without provenance | Details for autosend_shreya_sdk-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| autosend_shreya_sdk-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for autosend_shreya_sdk-2.0.0-py3-none-any.whl |
Total release size: 29.2 kB
Release files / autosend_shreya_sdk-2.0.0.tar.gz
| Download URL | autosend_shreya_sdk-2.0.0.tar.gz |
|---|---|
| Size | 13.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2410636400c420cced3942d0a0e45400311ffa228892c6803f8a0adf8e18180f
|
|
BLAKE2b-256 checksum How to use checksums |
ecb08c4e76a79e99121a32abb7878ab8f567f5c3dd677c53caf7c79d69810c58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / autosend_shreya_sdk-2.0.0-py3-none-any.whl
| Download URL | autosend_shreya_sdk-2.0.0-py3-none-any.whl |
|---|---|
| Size | 15.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c1e2c11deecb947a8dfe98947b2045cff48bf84909f8090ae9a4cf38bbc96446
|
|
BLAKE2b-256 checksum How to use checksums |
4f84e0c288d699e68b3573e18c946ba9a8426d7577ac1522beced8e9bcc484c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for autosend-shreya-sdk 2.0.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.