The official Python library for the Courier API
Actively maintained. Last release 6 days ago, commits in 17 of the last 26 weeks. A safe choice.
pip install trycourierCourier Python SDK
The Courier Python SDK provides typed access to the Courier REST API from Python applications. Use it to send notifications, manage user profiles, check message status, issue JWT tokens for client-side SDKs, and more.
Installation
pip install trycourier
Requires Python 3.8+.
Quick Start
import os
from courier import Courier
client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # the default, can be omitted
)
response = client.send.message(
message={
"to": {"user_id": "your_user_id"},
"template": "your_template_id",
"data": {"foo": "bar"},
},
)
print(response.request_id)
The client reads COURIER_API_KEY from your environment automatically.
An async client is also available as AsyncCourier, with the same methods.
Documentation
Full documentation: courier.com/docs/sdk-libraries/python