{"id":4824,"library":"types-boto3-ses","title":"Type annotations for boto3 SES","description":"types-boto3-ses provides comprehensive type annotations for the Amazon Simple Email Service (SES) client within the `boto3` library. This package is part of the `mypy-boto3-builder` project, designed to enhance type checking, autocompletion, and static analysis for `boto3` users with tools like MyPy, Pyright, VSCode, and PyCharm. The current version is 1.42.3, with new releases typically following `boto3` updates and `mypy-boto3-builder` improvements.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type-hinting","aws","boto3","ses","mypy","pyright","static-analysis"],"install":[{"cmd":"pip install types-boto3-ses","lang":"bash","label":"Standalone installation"},{"cmd":"pip install 'types-boto3[ses]'","lang":"bash","label":"As an extra with types-boto3"}],"dependencies":[{"reason":"Provides the underlying AWS SDK for Python that these types annotate.","package":"boto3"},{"reason":"Requires Python 3.9 or newer.","package":"python","optional":false}],"imports":[{"note":"For explicit type hinting of the SES client object.","symbol":"SESClient","correct":"from types_boto3_ses.client import SESClient"},{"note":"For explicit type hinting of specific SES TypeDefs.","symbol":"EmailAddressIdentity","correct":"from types_boto3_ses.type_defs import EmailAddressIdentity"},{"note":"Recommended for conditional import of type-only dependencies to avoid runtime overhead.","symbol":"TYPE_CHECKING","correct":"from typing import TYPE_CHECKING\nif TYPE_CHECKING:\n    from types_boto3_ses.client import SESClient"}],"quickstart":{"code":"import os\nfrom typing import TYPE_CHECKING\n\nimport boto3\n\n# Conditionally import type hints only during type checking\nif TYPE_CHECKING:\n    from types_boto3_ses.client import SESClient\n    from types_boto3_ses.type_defs import IdentityListResponseTypeDef\n\n# Ensure AWS credentials are available for boto3\n# For example, by setting AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables\n# or configuring the AWS CLI.\n\ndef list_ses_identities() -> None:\n    # boto3.client returns a dynamically typed client. With types-boto3-ses installed,\n    # static analysis tools like mypy will correctly infer types.\n    # For explicit type hints, you can annotate the client:\n    client: SESClient = boto3.client(\"ses\", region_name=os.environ.get('AWS_REGION', 'us-east-1'))\n\n    try:\n        # The response type will be correctly inferred by type checkers\n        response: IdentityListResponseTypeDef = client.list_identities(IdentityType='EmailAddress')\n        print(\"Verified SES Identities:\")\n        for identity in response.get('Identities', []):\n            print(f\"- {identity}\")\n    except client.exceptions.ClientError as e:\n        print(f\"Error listing SES identities: {e}\")\n\nif __name__ == \"__main__\":\n    # Set a dummy region if not running in an AWS environment\n    if 'AWS_REGION' not in os.environ:\n        os.environ['AWS_REGION'] = 'us-east-1'\n    list_ses_identities()","lang":"python","description":"This example demonstrates how to initialize an SES client and use type annotations for both the client itself and its method responses. Type checkers will use `types-boto3-ses` to provide accurate suggestions and catch potential errors."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"As of mypy-boto3-builder version 8.12.0 (which generated types-boto3-ses 1.42.3), support for Python 3.8 has been explicitly removed. All `types-boto3` packages now require Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0, types-boto3-ses >= 1.42.0"},{"fix":"Review your codebase for direct imports and usage of TypeDef names and update them according to the new conventions.","message":"In `mypy-boto3-builder` version 8.9.0, there were breaking changes to TypeDef naming conventions. Specifically, some TypeDef names were shortened (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`) and conflicting `Extra` postfixes were moved (`CreateDistributionExtraRequestTypeDef` to `CreateDistributionRequestExtraTypeDef`). While not specific to SES, this change affects all generated service TypeDefs.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0, types-boto3-ses >= 1.39.0"},{"fix":"Consider installing `types-boto3-lite-ses` instead (e.g., `pip install types-boto3-lite-ses`) or disable PyCharm's internal type checker and use MyPy/Pyright.","message":"Users of PyCharm may experience slow performance or high CPU usage when using `types-boto3` packages due to issues with PyCharm's type checker and `Literal` overloads. It is recommended to use `types-boto3-lite` for better performance or to configure PyCharm to use external type checkers like MyPy or Pyright.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always refer to the latest AWS documentation for service names and use the corresponding `types-boto3` package or builder options.","message":"While not directly affecting SES, the `sms-voice` service was removed from generation in `mypy-boto3-builder` version 8.11.0, recommending the use of `pinpoint-sms-voice` instead. This highlights a pattern of service renames or deprecations that can occur within the AWS ecosystem and the `types-boto3` project.","severity":"deprecated","affected_versions":"mypy-boto3-builder >= 8.11.0"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}