mypy-boto3-synthetics provides comprehensive type annotations for the AWS Synthetics service within the boto3 library. It enables static type checking with tools like MyPy and Pyright, enhancing developer experience with features such as auto-completion and early bug detection in IDEs like VSCode and PyCharm. The package, currently at version 1.42.3, is generated by mypy-boto3-builder and is actively maintained, with updates often aligned with boto3 releases.
pip install mypy-boto3-syntheticsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to obtain a type-hinted AWS Synthetics client and use it to call an API method (e.g., `get_canary`). Explicit type annotations are shown for clarity and to ensure full type checking capabilities.
Upgrade your Python environment to 3.9 or a later version. Update your `requires_python` in `pyproject.toml` or `setup.py`.
Review and update `TypedDict` references in your code to match the new, shorter naming conventions provided by the stubs. Consult the specific service's `type_defs.pyi` for correct names.
Ensure `mypy-boto3-synthetics` or `boto3-stubs[synthetics]` is correctly installed in your project's environment. For standalone packages, explicit type annotations (`client: SyntheticsClient`) are often necessary for optimal IDE support.
Always add explicit type hints for the client object returned by `session.client()` or `boto3.client()`.
Always verify the correct service name and import path for the AWS service you intend to use. Refer to the official `boto3-stubs` documentation for the latest naming conventions.