mypy-boto3-route53-recovery-readiness
mypy-boto3-route53-recovery-readiness provides type annotations for the `boto3` AWS Route53RecoveryReadiness service, allowing static type checkers like `mypy` to validate `boto3` usage. It's currently at version 1.42.3 and is part of the `mypy-boto3-builder` ecosystem, which generates packages for all `boto3` services and is frequently updated, often in sync with `boto3` releases.
Warnings
- breaking Python 3.8 support has been removed since `mypy-boto3-builder` version 8.12.0. Projects using this package must target Python 3.9 or newer.
- breaking As of `mypy-boto3-builder` version 8.12.0, packages migrated to PEP 561 compliance. This change might affect how type checkers locate and process stubs in certain environments or older project setups.
- breaking Type definition (TypeDef) names for service requests and responses underwent renaming in `mypy-boto3-builder` version 8.9.0. Common patterns like `RequestRequestTypeDef` were shortened to `RequestTypeDef`, and `ExtraRequestTypeDef` became `RequestExtraTypeDef`.
- gotcha This library provides type annotations *only*; it does not alter `boto3`'s runtime behavior or provide any runtime functionality itself. Its sole purpose is to enable static type checking.
- gotcha The `mypy-boto3` stub packages are tightly coupled to specific `boto3` versions. Using a `mypy-boto3-*` package version that doesn't align with your installed `boto3` version can lead to incorrect or missing type hints.
Install
-
pip install mypy-boto3-route53-recovery-readiness
Imports
- Route53RecoveryReadinessClient
from mypy_boto3_route53_recovery_readiness.client import Route53RecoveryReadinessClient
- ListReadinessChecksOutputTypeDef
from mypy_boto3_route53_recovery_readiness.type_defs import ListReadinessChecksOutputTypeDef
Quickstart
import boto3
from mypy_boto3_route53_recovery_readiness.client import Route53RecoveryReadinessClient
from mypy_boto3_route53_recovery_readiness.type_defs import ListReadinessChecksOutputTypeDef
import os
def get_readiness_checks() -> ListReadinessChecksOutputTypeDef:
"""Fetches a list of Route53 Recovery Readiness checks and returns their typed response."""
# mypy-boto3 provides type hints for the boto3 client object
client: Route53RecoveryReadinessClient = boto3.client(
"route53-recovery-readiness",
region_name=os.environ.get("AWS_REGION", "us-east-1")
)
response = client.list_readiness_checks()
print(f"Found {len(response.get('ReadinessChecks', []))} readiness checks.")
return response
if __name__ == "__main__":
# When mypy is run on this file, it will verify that
# `get_readiness_checks` returns a `ListReadinessChecksOutputTypeDef`
# and that subsequent access to 'result' follows that type definition.
result = get_readiness_checks()
# Example of type-safe access:
for check in result.get('ReadinessChecks', []):
print(f" - {check.get('ReadinessCheckName', 'N/A')}")