Python SDK for the Sendlix gRPC API
Project description
Sendlix Python SDK
This package provides a Python implementation of the Sendlix gRPC SDK that aims for feature parity with the official reference client. It exposes the same high-level clients (EmailClient, GroupClient) and the same authentication helper (Auth).
Installation
pip install sendlix
Authentication
API keys are issued in the format secret.keyId. You can either pass the key string directly to a client or create a reusable Auth instance:
from sendlix import Auth, EmailClient
auth = Auth("sk_xxxxxxxxx.xxx")
email_client = EmailClient(auth)
# or
email_client = EmailClient("sk_xxxxxxxxx.xxx")
The token fetched by Auth is cached until it expires.
Available Clients
EmailClient
Send transactional emails, raw EML messages, or trigger group emails.
Methods:
send_email(mail_options, additional_options=None)– send a regular email withto,cc,bcc,html/text, attachments, and inline images.send_eml_email(eml, additional_options=None)– upload raw EML content from a path, bytes, or buffer.send_group_email(group_mail)– broadcast to a predefined Sendlix group.
GroupClient
Manage recipients inside Sendlix groups.
insert_email_into_group(group_id, email_records, fail_handling="ABORT")delete_email_from_group(group_id, email)contains_email_in_group(group_id, email)
Each method mirrors the semantics and error handling described in the reference SDK documentation.
Examples
Sending an email
from sendlix import EmailClient
client = EmailClient("sk_xxxxxxxxx.xxx")
response = client.send_email(
{
"from": {"email": "sender@example.com", "name": "Sender"},
"to": ["recipient@example.com"],
"subject": "Hello World!",
"html": "<h1>Welcome!</h1><p>This is a test email.</p>",
}
)
print(response)
Adding emails to a group
from sendlix import GroupClient
group_client = GroupClient("sk_xxxxxxxxx.xxx")
group_client.insert_email_into_group(
"groupId123",
[
{"email": "a@example.com"},
{
"email": {"email": "b@example.com", "name": "User B"},
"substitutions": {"plan": "pro"},
},
],
)
Development
- Regenerate gRPC stubs:
.\build.cmd - Run tests:
pytest
Local quickstart
If you are working from a clone of this repository (instead of the published pip install sendlix package), make sure you run the code inside the provided virtual environment so that the correct dependency versions (especially protobuf>=5.29.0) are available:
python -m venv .venv
./.venv/Scripts/Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e .[dev]
Running the SDK with an older global installation of google.protobuf (<5.29) will raise an ImportError: cannot import name 'runtime_version' when the generated gRPC stubs are imported. Activating the virtual environment (or upgrading protobuf in your global interpreter) resolves the issue.
The project uses the Apache-2.0 license.
Project details
Release history Release notifications | RSS feed
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 sendlix-1.0.0.tar.gz.
File metadata
- Download URL: sendlix-1.0.0.tar.gz
- Upload date:
- Size: 19.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81ff9594c3142152c60582976450b8792c7af982fc84f93cb1ab8936d15e6a30
|
|
| MD5 |
340146ebfefabca216372509b319a8cc
|
|
| BLAKE2b-256 |
abc993cfb0f89769ea8d206988e742bcb045349fc939c6f1fecfcb5bd964258c
|
Provenance
The following attestation bundles were made for sendlix-1.0.0.tar.gz:
Publisher:
release.yml on sendlix/python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sendlix-1.0.0.tar.gz -
Subject digest:
81ff9594c3142152c60582976450b8792c7af982fc84f93cb1ab8936d15e6a30 - Sigstore transparency entry: 780511741
- Sigstore integration time:
-
Permalink:
sendlix/python@97fff9bbb287010ac01e62ef43601182c2f90376 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sendlix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@97fff9bbb287010ac01e62ef43601182c2f90376 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file sendlix-1.0.0-py3-none-any.whl.
File metadata
- Download URL: sendlix-1.0.0-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08a2dd7bb141dc1d09c31e690c236b260858ee37b96b61c55966030b1482ce39
|
|
| MD5 |
c4d7a0a51d2be2125f64fa5f99a9631f
|
|
| BLAKE2b-256 |
3757309673c57bd88934d334a36bc62d2e9b68cb108c5fbb19f5898de24feb15
|
Provenance
The following attestation bundles were made for sendlix-1.0.0-py3-none-any.whl:
Publisher:
release.yml on sendlix/python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sendlix-1.0.0-py3-none-any.whl -
Subject digest:
08a2dd7bb141dc1d09c31e690c236b260858ee37b96b61c55966030b1482ce39 - Sigstore transparency entry: 780511749
- Sigstore integration time:
-
Permalink:
sendlix/python@97fff9bbb287010ac01e62ef43601182c2f90376 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/sendlix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@97fff9bbb287010ac01e62ef43601182c2f90376 -
Trigger Event:
workflow_dispatch
-
Statement type: