mypy-boto3-route53domains Type Stubs
mypy-boto3-route53domains provides type annotations for the boto3 Route53Domains service, generated with the mypy-boto3-builder. These stubs enable static type checking for your boto3 calls related to AWS Route53Domains, enhancing code quality and developer experience. The current version is 1.42.3, and updates are released frequently, typically mirroring boto3 releases and builder improvements.
Warnings
- breaking Python 3.8 support has been removed. All `mypy-boto3` packages, including `mypy-boto3-route53domains`, now require Python 3.9 or newer.
- gotcha This package provides *type stubs* for boto3. You must also install `boto3` (and potentially `mypy`) separately for your code to run and for type checking to occur.
- breaking The `mypy-boto3-builder` (which generates these stubs) migrated to PEP 561 packages. While this generally improves `mypy`'s ability to find stubs, older configurations relying on `MYPYPATH` or `types-*` packages might need adjustment.
- breaking TypeDef naming conventions were changed in builder version 8.9.0 to be shorter and resolve conflicts. This may break existing type hints if you were explicitly importing TypeDefs.
Install
-
pip install mypy-boto3-route53domains boto3 -
pip install mypy-boto3-route53domains
Imports
- Route53DomainsClient
from mypy_boto3_route53domains.client import Route53DomainsClient
- Paginator
from mypy_boto3_route53domains.paginator import ListDomainsPaginator
- TypeDef
from mypy_boto3_route53domains.type_defs import RegisterDomainRequestRequestTypeDef
Quickstart
import boto3
from mypy_boto3_route53domains.client import Route53DomainsClient
def get_domains_client() -> Route53DomainsClient:
"""Get a typed Route53Domains client."""
# boto3_client is actually an Any type without stubs
# With mypy-boto3-route53domains installed, this is now typed
boto3_client: Route53DomainsClient = boto3.client("route53domains")
return boto3_client
if __name__ == "__main__":
client = get_domains_client()
print(f"Client type: {type(client)}")
# Example operation (requires AWS credentials configured)
try:
response = client.list_domains()
print(f"First domain: {response['Domains'][0]['DomainName']}")
except Exception as e:
print(f"Could not list domains (ensure AWS credentials are configured): {e}")