Registry / communication / trycourier

trycourier

JSON →
library9.2.0pypypi✓ verified 27d ago

Python SDK for Courier notification API (multi-channel: email, SMS, push, in-app). Current version is 7.9.0. Install name is trycourier (pip install trycourier) but import name changed to courier in v5+ (from courier.client import Courier). The SDK was completely rewritten with Fern code generation in v5, breaking all v4 code.

pip install trycourier
INSTALL
IMPORT
SIG · TRYCOURIER
T
trycourier
communicationpythonv9.2.0
Install
5.0s avg
Import
Disk
36MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v9.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 37.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.0s · import 0.000s · 37MB
36MB installed
● package 36MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Courier
# Current v5+ API (import from courier, not trycourier) from courier.client import Courier import courier client = Courier(authorization_token='YOUR_COURIER_AUTH_TOKEN') response = client.send( message=courier.ContentMessage( to=courier.UserRecipient(email='user@example.com'), content=courier.ElementalContent( version='2020-01-01', elements=[courier.ElementalNode_Text(content='Hello!')] ), routing=courier.Routing(method='all', channels=['email']) ) ) print(response.request_id)
# Old v4 import pattern (broken in v5+): from trycourier import Courier client = Courier(auth_token='YOUR_TOKEN') client.send( event='notification-id', recipient='recipient-id', data={'name': 'Alice'} )
Install with pip install trycourier but import from courier (not trycourier). v4 used from trycourier import Courier with auth_token= and event/recipient params. v5+ uses from courier.client import Courier with authorization_token= and structured message objects.

v5+ API. Install is trycourier, import is courier. Sync and async clients available.

# pip install trycourier from courier.client import Courier import courier client = Courier( authorization_token='YOUR_COURIER_AUTH_TOKEN' # or set env var COURIER_AUTH_TOKEN ) # Send using a template (workflow) response = client.send( message=courier.TemplateMessage( template='your-template-id', # template ID from Courier dashboard to=courier.UserRecipient( email='user@example.com', user_id='user-123' ), data={ 'name': 'Alice', 'action_url': 'https://yourapp.com' } ) ) print('Request ID:', response.request_id) # Async client from courier.client import AsyncCourier import asyncio async def send(): async with AsyncCourier(authorization_token='YOUR_TOKEN') as client: await client.send(message=courier.TemplateMessage( template='your-template-id', to=courier.UserRecipient(email='user@example.com') )) asyncio.run(send())
Debug
Known issues
breakingInstall name (trycourier) and import name (courier) differ since v5. pip install trycourier then from courier.client import Courier. LLMs frequently generate from trycourier import Courier which raises ImportError on v5+.
fix
pip install trycourier then import from courier: from courier.client import Courier
affects: >= 5.0
breakingComplete API rewrite in v5 using Fern code generation. v4 API (Courier(auth_token=), client.send(event=, recipient=, data=)) is completely gone. All v4 code raises ImportError or AttributeError on v5+.
fix
Migrate to: from courier.client import Courier; client = Courier(authorization_token=...); client.send(message=courier.TemplateMessage(template=..., to=courier.UserRecipient(...)))
affects: >= 5.0
breakingauth_token= parameter renamed to authorization_token= in v5. Passing auth_token= raises TypeError.
fix
Replace Courier(auth_token='...') with Courier(authorization_token='...') or set COURIER_AUTH_TOKEN env var.
affects: >= 5.0
breakingResource-scoped methods introduced in v5. Old flat methods like courier.deleteBrands() replaced with courier.brands.delete(). All flat method calls raise AttributeError.
fix
Use resource-scoped API: client.brands.delete(...), client.lists.get(...), etc.
affects: >= 5.0
gotchaThe COURIER_AUTH_TOKEN environment variable is read automatically if authorization_token= is not passed. Useful for 12-factor apps but can cause silent auth failures if the wrong env var is set.
fix
Set COURIER_AUTH_TOKEN in your environment, or pass authorization_token= explicitly. Verify with: python -c "import os; print(os.environ.get('COURIER_AUTH_TOKEN'))"
affects: >= 5.0
Upgrade
Version history
9.2.0latest on PyPI · released Aug 26, 2026
Audit
Dependencies
httpxrequiredRequired. Installed automatically.
pydanticrequiredRequired. Installed automatically.
Agent activity
42 hits · last 30 days
node
40
OpenAI (training)
1
Resources