Official Python SDK for Mailrify
Project description
Mailrify Python SDK
Official Python client for the Mailrify transactional and marketing email API.
Installation
The package is not published yet. Clone the repository and install in editable mode:
pip install -e .
Python 3.9 or higher is required.
Quickstart (Sync)
import mailrify
mailrify.api_key = "YOUR_API_KEY"
params: mailrify.Emails.SendParams = {
"to": ["customer@example.com"],
"from": "you@yourdomain.com",
"subject": "Welcome!",
"text": "Hello from Mailrify!",
}
email: mailrify.Emails.SendResponse = mailrify.Emails.send(params)
print(email)
Quickstart (Async)
import asyncio
import mailrify
async def main() -> None:
async with mailrify.AsyncClient(api_key="YOUR_API_KEY") as client:
email = await client.emails.send(
{
"to": ["customer@example.com"],
"from": "you@yourdomain.com",
"subject": "Welcome!",
"html": "<strong>Hello from Mailrify!</strong>",
}
)
print(email.email_id)
asyncio.run(main())
Project Layout
src/mailrify/: core SDK implementationscripts/sync_openapi.py: fetches the OpenAPI spec and regenerates modelstests/: unit and integration tests (to be added)
Development Setup
python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
Run quality gates:
ruff check src tests
black --check src tests
mypy src
pytest
Integration Tests
Integration tests exercise the live Mailrify API and are skipped unless you opt in. Export the required credentials first:
export MAILRIFY_API_KEY="your_live_api_key"
export MAILRIFY_INTEGRATION_FROM="verified-sender@yourdomain.com"
export MAILRIFY_INTEGRATION_TO="recipient@example.com"
# optional override
export MAILRIFY_BASE_URL="https://app.mailrify.com/api"
Then run:
pytest -m integration
The suite currently includes a smoke test for listing emails and sending a single message; ensure the addresses you provide are valid in your Mailrify account.
Contributing
Contributions are welcome! Please open an issue or pull request after reading CONTRIBUTING.md.
License
Distributed under the terms of the MIT License.
Project details
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 mailrify-0.0.2.tar.gz.
File metadata
- Download URL: mailrify-0.0.2.tar.gz
- Upload date:
- Size: 15.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 |
ca9b8e0e6789e27d85e85142351442550433572044d104066598dcb6c18337a6
|
|
| MD5 |
7b2599ab9f3153f53d7ff18ea3197b16
|
|
| BLAKE2b-256 |
cbfa198f03a0ef24b228328dee35cdeb77ff2b3d9144353e06baf726bf1fa0ad
|
Provenance
The following attestation bundles were made for mailrify-0.0.2.tar.gz:
Publisher:
release.yml on Mailrify/mailrify-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mailrify-0.0.2.tar.gz -
Subject digest:
ca9b8e0e6789e27d85e85142351442550433572044d104066598dcb6c18337a6 - Sigstore transparency entry: 662575866
- Sigstore integration time:
-
Permalink:
Mailrify/mailrify-python@d937e952fc05976a9911362c7ab6f4e14ce5a691 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/Mailrify
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d937e952fc05976a9911362c7ab6f4e14ce5a691 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mailrify-0.0.2-py3-none-any.whl.
File metadata
- Download URL: mailrify-0.0.2-py3-none-any.whl
- Upload date:
- Size: 17.3 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 |
cefeeb23340b02948eb8ef97a2702f0d784bd2e155206224859341b904c42e4f
|
|
| MD5 |
fcb37c79e3847c404b65279e57a310a1
|
|
| BLAKE2b-256 |
94d771f5fd21f1a3da0aa8cdfc627e7d6910f1916d4f556b9b74fe6779cd8fa6
|
Provenance
The following attestation bundles were made for mailrify-0.0.2-py3-none-any.whl:
Publisher:
release.yml on Mailrify/mailrify-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mailrify-0.0.2-py3-none-any.whl -
Subject digest:
cefeeb23340b02948eb8ef97a2702f0d784bd2e155206224859341b904c42e4f - Sigstore transparency entry: 662575869
- Sigstore integration time:
-
Permalink:
Mailrify/mailrify-python@d937e952fc05976a9911362c7ab6f4e14ce5a691 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/Mailrify
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d937e952fc05976a9911362c7ab6f4e14ce5a691 -
Trigger Event:
push
-
Statement type: