{"id":3122,"library":"mypy-boto3-pinpoint","title":"mypy-boto3-pinpoint: Type Annotations for AWS Pinpoint with boto3","description":"mypy-boto3-pinpoint provides drop-in type annotations for the AWS Pinpoint service client within the boto3 library. It enables static type checking with tools like mypy and enhances IDE features such as autocompletion and error detection for boto3 Pinpoint API calls. The package, currently at version 1.42.3, is generated by mypy-boto3-builder 8.12.0 and aligns its versioning with boto3 releases to ensure compatibility and up-to-date type information. It is actively maintained with frequent updates to reflect changes in boto3 and Python typing standards.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","pinpoint","typing"],"install":[{"cmd":"pip install mypy-boto3-pinpoint boto3","lang":"bash","label":"Install with boto3"}],"dependencies":[{"reason":"mypy-boto3-pinpoint provides type annotations; boto3 is the actual runtime library it annotates.","package":"boto3","optional":false}],"imports":[{"note":"The type stub is provided by mypy_boto3_pinpoint, not directly by boto3 itself. Although modern type checkers often infer this, explicit import from the stub package is the most robust approach.","wrong":"from boto3.client import PinpointClient","symbol":"PinpointClient","correct":"from mypy_boto3_pinpoint.client import PinpointClient"}],"quickstart":{"code":"from typing import TYPE_CHECKING\nimport boto3\nfrom boto3.session import Session\n\nif TYPE_CHECKING:\n    from mypy_boto3_pinpoint.client import PinpointClient\n\ndef get_pinpoint_client() -> 'PinpointClient':\n    # In a real application, consider using AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY\n    # environment variables or other boto3 credential providers.\n    # For local development or testing, this might use ~/.aws/credentials\n    # or IAM roles.\n    session = Session(region_name='us-east-1')\n    return session.client('pinpoint')\n\n# Example usage (will be type-checked by mypy):\nclient = get_pinpoint_client()\n# client.send_messages(...) # mypy will now validate arguments for send_messages\nprint(f\"Pinpoint client created: {client}\")\n\n# Without TYPE_CHECKING, the import is ignored at runtime, preventing a direct dependency on the stub package.\n# In a runtime context without type checking, `client` is simply the boto3 client object.","lang":"python","description":"This quickstart demonstrates how to obtain a type-hinted Pinpoint client using `boto3.session.Session().client()` and `mypy_boto3_pinpoint.client.PinpointClient`. The `if TYPE_CHECKING:` block ensures that the type stub import is only processed by static analysis tools, preventing a runtime dependency on the stub package."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Support for Python 3.8 was removed starting with mypy-boto3-builder v8.12.0, which affects all generated stub packages including mypy-boto3-pinpoint. The minimum required Python version is now 3.9.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0 (and corresponding mypy-boto3-pinpoint versions)"},{"fix":"Update explicit TypeDef imports and references to use the shorter, revised names. Consult the `mypy_boto3_pinpoint.type_defs` module for the correct names.","message":"Specific TypeDef names were changed for consistency and brevity (e.g., `CreateDistributionRequestRequestTypeDef` to `CreateDistributionRequestTypeDef`) in mypy-boto3-builder v8.9.0. If your code explicitly references these verbose TypeDefs, it will break.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0 (and corresponding mypy-boto3-pinpoint versions)"},{"fix":"Ensure `boto3` is installed alongside `mypy-boto3-pinpoint` using `pip install boto3 mypy-boto3-pinpoint`.","message":"mypy-boto3-pinpoint provides *only* type annotations. The actual `boto3` library must be installed separately for the code to run at runtime. Failure to install `boto3` will result in `ModuleNotFoundError` or similar runtime errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"When troubleshooting or upgrading, note that the builder's version does not directly match the stub package's version. Refer to the `mypy-boto3-builder` release notes for changes affecting stub generation and `mypy-boto3-pinpoint` PyPI/docs for its specific version compatibility with `boto3`.","message":"The versioning of individual `mypy-boto3-*` service stub packages (like `mypy-boto3-pinpoint`) is tied to the `boto3` version they annotate. However, the `mypy-boto3-builder` tool, which generates these stubs, has its own independent versioning.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Wrap your `mypy-boto3-pinpoint` imports within an `if TYPE_CHECKING:` block, as shown in the quickstart example, to ensure they are only active during type checking.","message":"While many IDEs and recent `mypy` versions can infer types without explicit stub imports, using `if TYPE_CHECKING:` guards the stub imports. This prevents adding the stub package as a runtime dependency and can avoid potential import conflicts or performance issues with some tooling.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}