mypy-boto3-transfer

1.42.84 · active · verified Sat Apr 11

mypy-boto3-transfer provides type annotations for the `boto3` Transfer service, generated with `mypy-boto3-builder`. It ensures `mypy` can correctly validate usage of the `boto3` Transfer client and associated data types. The library is actively maintained, with releases typically synchronized with `boto3` updates and `mypy-boto3-builder` enhancements, currently at version 1.42.84.

Warnings

Install

Imports

Quickstart

Demonstrates how to import and use the `TransferClient` type to annotate a `boto3` client, enabling static type checking with `mypy` for AWS Transfer service operations. It also shows a common response type definition.

import boto3
from mypy_boto3_transfer.client import TransferClient
from mypy_boto3_transfer.type_defs import ListServersResponseTypeDef
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    # These imports are for type checking only and will not be executed at runtime
    # They provide type hints for boto3 service clients and responses.
    client: TransferClient = boto3.client("transfer")
    response: ListServersResponseTypeDef = client.list_servers()
    print(f"Found {len(response['Servers'])} Transfer servers.")

# Example of actual runtime usage (uncomment to run)
# client = boto3.client("transfer")
# response = client.list_servers()
# print(f"Runtime: Found {len(response['Servers'])} Transfer servers.")

view raw JSON →