mypy-boto3-signin Type Annotations
mypy-boto3-signin provides static type annotations for the `boto3` AWS SDK's SignInService. It is generated by `mypy-boto3-builder` and aims to enhance developer experience by enabling IDE auto-completion, catching type-related errors at development time, and improving code readability for `boto3` client interactions with the SignInService. Releases are frequent, typically aligning with new `boto3` versions or `mypy-boto3-builder` updates.
Warnings
- breaking Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0, which generates `mypy-boto3-signin`. Projects using older Python versions must update to Python 3.9 or newer.
- breaking In `mypy-boto3-builder` 8.9.0, there were breaking changes to `TypeDef` naming conventions, e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`. While specific to service names, this applies generally across the `mypy-boto3` ecosystem and could affect custom stub usage.
- gotcha This package provides *only* type stubs. The actual `boto3` library must be installed separately for the code to run at runtime.
- gotcha The `mypy-boto3` ecosystem migrated to PEP 561-compliant packages. While beneficial, this might cause issues with very old `mypy` or `setuptools` configurations.
- gotcha Explicit type annotations (e.g., `client: SignInServiceClient = boto3.client(...)`) may be necessary for full IDE auto-completion in some environments (e.g., VSCode with certain extensions), even though `mypy` and PyCharm often infer types automatically.
Install
-
pip install mypy-boto3-signin boto3
Imports
- SignInServiceClient
from mypy_boto3_signin.client import SignInServiceClient
- CreateAccountSubscriptionOutputTypeDef
from mypy_boto3_signin.type_defs import CreateAccountSubscriptionOutputTypeDef
Quickstart
import boto3
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from mypy_boto3_signin.client import SignInServiceClient
from mypy_boto3_signin.type_defs import CreateAccountSubscriptionOutputTypeDef
def create_signin_subscription() -> CreateAccountSubscriptionOutputTypeDef:
# A real 'signin' service operation might be different or require more parameters.
# This is a hypothetical example for demonstration purposes.
client: SignInServiceClient = boto3.client("signin")
response = client.create_account_subscription(
# Actual parameters would go here, e.g., 'SourceId': 'some-id'
)
print(f"Subscription created: {response}")
return response
if __name__ == "__main__":
# This code is illustrative. Actual 'signin' service interaction
# will depend on its capabilities and available operations.
try:
result = create_signin_subscription()
print(f"Result type: {type(result)}")
except Exception as e:
print(f"Error interacting with SignInService: {e}")