boto3-stubs provides comprehensive type annotations for the `boto3` AWS SDK for Python, enabling static type checking with tools like MyPy and PyRight, and enhancing IDE auto-completion. It is generated by `mypy-boto3-builder` and is actively maintained with frequent updates, typically aligning with `boto3` releases to ensure compatibility with the latest AWS services and features.
pip install boto3-stubsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `boto3-stubs` to add type annotations to `boto3` client calls. By installing `boto3-stubs` (or `boto3-stubs[s3]` for S3 specific stubs), type checkers like MyPy will understand the return types and argument types of `boto3.client('s3')`, and IDEs will provide better auto-completion. Explicitly importing `S3Client` from `mypy_boto3_s3.client` allows for clear type hinting of the client object itself.
Upgrade your Python environment to 3.9 or newer.
Ensure your project's `pyproject.toml` or `setup.py` correctly references PEP 561-compliant stub packages. Re-evaluate any custom build or packaging logic that interacts directly with stub files.
Update your code to use the `pinpoint-sms-voice` service and its corresponding types where applicable.
Update explicit TypeDef references in your code to match the new naming conventions.
Ensure `pip install boto3` is part of your project's dependency management.
Consider installing `boto3-stubs-lite` (`pip install boto3-stubs-lite`) or configure PyCharm to use MyPy/PyRight as the primary type checker.