Registry /
type-stubs / mypy-boto3-pinpoint-email
Install & Compatibility
Where this runs
tested against v1.43.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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.616s · 52MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.0s · import 0.568s · 53MB
50MB installed
● package 50MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
PinpointEmailClient
✓ from mypy_boto3_pinpoint_email.client import PinpointEmailClient
✗ from boto3.client import pinpointemail
For type hints, import the client type directly from mypy_boto3_pinpoint_email.client. Relying solely on boto3.client('pinpoint-email') will not provide full type-checking benefits without explicit annotation or other mypy-boto3 features.
Session
✓ from boto3.session import Session
Standard import for creating a boto3 session.
This quickstart demonstrates how to initialize the Pinpoint Email client with type annotations and send a simple email. It uses environment variables for sender and recipient emails for safe execution.
import os
from typing import TYPE_CHECKING
import boto3
from boto3.session import Session
# Import PinpointEmailClient for type hinting, conditionally for runtime performance
if TYPE_CHECKING:
from mypy_boto3_pinpoint_email.client import PinpointEmailClient
from mypy_boto3_pinpoint_email.type_defs import SendEmailResponseTypeDef
def send_pinpoint_email(recipient_email: str, sender_email: str, subject: str, body: str) -> None:
"""Sends an email using AWS Pinpoint Email service."""
session = Session()
client: 'PinpointEmailClient' = session.client("pinpoint-email")
response: 'SendEmailResponseTypeDef' = client.send_email(
FromEmailAddress=sender_email,
Destination={
'ToAddresses': [
recipient_email,
],
},
Content={
'Simple': {
'Subject': {
'Data': subject,
'Charset': 'UTF-8'
},
'Body': {
'Text': {
'Data': body,
'Charset': 'UTF-8'
}
}
}
}
)
print(f"Email sent! Message ID: {response['MessageId']}")
if __name__ == "__main__":
# Replace with your verified sender and recipient email addresses
# Ensure these are set as environment variables for production
SENDER = os.environ.get('PINPOINT_SENDER_EMAIL', 'verified@example.com')
RECIPIENT = os.environ.get('PINPOINT_RECIPIENT_EMAIL', 'recipient@example.com')
EMAIL_SUBJECT = "Hello from mypy-boto3 Pinpoint Email!"
EMAIL_BODY = "This is a test email sent using AWS Pinpoint Email with type annotations."
if SENDER == 'verified@example.com' or RECIPIENT == 'recipient@example.com':
print("Please set PINPOINT_SENDER_EMAIL and PINPOINT_RECIPIENT_EMAIL environment variables.")
print("Make sure the sender email is verified in AWS Pinpoint Email.")
else:
send_pinpoint_email(RECIPIENT, SENDER, EMAIL_SUBJECT, EMAIL_BODY)
Debug
Known issues
breakingAs of mypy-boto3-builder 8.12.0, Python 3.8 support has been removed. Ensure your projects use Python 3.9 or newer.fixUpgrade your Python environment to 3.9 or a later version.
affects: mypy-boto3-builder >= 8.12.0 (affecting mypy-boto3-pinpoint-email >= 1.42.0)
breakingType definition (TypeDef) naming conventions underwent breaking changes in mypy-boto3-builder 8.9.0. This may affect direct imports of TypeDefs from `mypy_boto3_pinpoint_email.type_defs` or similar modules, potentially leading to 'name not found' errors.fixConsult the official mypy-boto3 documentation for the updated TypeDef names and adjust your import statements and type annotations accordingly.
affects: mypy-boto3-builder >= 8.9.0 (affecting mypy-boto3-pinpoint-email versions generated by it)
gotchaFor optimal IDE auto-completion and type hinting, especially in VSCode or PyCharm, explicit type annotations are recommended when obtaining a client, e.g., `client: PinpointEmailClient = session.client('pinpoint-email')`.fixAlways use explicit type annotations for boto3 clients and resources: `client: 'PinpointEmailClient' = session.client('pinpoint-email')`. affects: All
gotchaPylint may report undefined variable errors when using `typing.TYPE_CHECKING` guards. A workaround is to conditionally assign `object` to types when `TYPE_CHECKING` is false.fixImplement conditional type assignment: `if TYPE_CHECKING: from mypy_boto3_pinpoint_email.client import PinpointEmailClient else: PinpointEmailClient = object`.
affects: All
deprecatedWhile not directly for `pinpoint-email`, a related service, `sms-voice`, was deprecated in mypy-boto3-builder 8.11.0 in favor of `pinpoint-sms-voice`. This highlights a general pattern where AWS service name changes can lead to stub package changes, requiring updates to imports for affected services.fixAlways verify service names and corresponding stub package imports against the latest mypy-boto3 documentation, especially after a boto3 or mypy-boto3-builder update.
affects: mypy-boto3-builder >= 8.11.0
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredRuntime dependency for interacting with AWS services.
mypyoptionalStatic type checker, as this library provides type stubs for it.
pythonrequiredRequires Python 3.9 or higher due to recent builder changes.