mypy-boto3-rds provides type annotations for the AWS boto3 RDS service, enhancing static analysis and code completion for `boto3.client("rds")` and related service components. It is automatically generated by `mypy-boto3-builder` and aims to synchronize its version with the corresponding `boto3` release, offering up-to-date type hints for mypy, pyright, and various IDEs. The current version is 1.42.75, reflecting its alignment with `boto3`.
pip install mypy-boto3-rdsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `mypy-boto3-rds` for type-hinting a `boto3` RDS client. It shows explicit type annotation for the client, an API call with type-hinted response, and usage of a paginator. The `TYPE_CHECKING` block ensures that type-only imports do not affect runtime dependencies. Note that `boto3-stubs[rds]` is the idiomatic way to install type annotations for a specific service.
Upgrade your Python environment to 3.9 or newer. The `requires_python` field is `>=3.9`.
Ensure your type checker (e.g., mypy, pyright) is up-to-date and configured to correctly resolve PEP 561 packages. Generally, this migration improves discoverability.
Refer to the `mypy-boto3-builder` release notes and the specific service documentation for `mypy-boto3-rds` when upgrading to check for TypeDef name changes. Update your code to use the new names.
Use a `from typing import TYPE_CHECKING` block. Inside this block, import the `mypy-boto3-rds` types. In the runtime path, assign `object` to these type aliases, e.g., `if TYPE_CHECKING: from mypy_boto3_rds.client import RDSClient else: RDSClient = object`.
Always pin your `boto3` and `mypy-boto3-rds` (or `boto3-stubs`) versions in your `requirements.txt` or `pyproject.toml` to ensure consistency. For example: `boto3==1.x.y` and `boto3-stubs[rds]==1.x.y`.
Ensure `boto3` is installed alongside `mypy-boto3-rds`. For example, `pip install boto3 mypy-boto3-rds`.