Type annotations for boto3 License Manager User Subscriptions
mypy-boto3-license-manager-user-subscriptions provides type annotations for the `boto3` LicenseManagerUserSubscriptions service, ensuring static type checking for AWS SDK usage in Python. It is currently at version 1.42.3 and is actively maintained, with releases frequently synchronised with `boto3` updates via the `mypy-boto3-builder`.
Warnings
- breaking Support for Python 3.8 has been officially removed starting from mypy-boto3-builder 8.12.0. Projects using this package on Python 3.8 will encounter compatibility issues.
- breaking Version 8.9.0 of `mypy-boto3-builder` introduced breaking changes to `TypeDef` naming conventions, shortening names and reordering 'Extra' postfixes. This can cause type-checking errors if you explicitly reference these `TypedDict` types.
- breaking As of `mypy-boto3-builder` 8.9.0, the legacy `mypy-boto3` package was moved to a separate product and is no longer generated alongside `boto3-stubs`. Users relying on the monolithic `mypy-boto3` package might need to adjust their installations.
- gotcha The `mypy-boto3` ecosystem migrated to PEP 561 compliant packages in builder version 8.12.0. While this improves type checker integration, it might affect custom `mypy` configurations or complex project structures that previously relied on non-standard stub discovery methods.
- gotcha While not directly affecting `LicenseManagerUserSubscriptions`, the `sms-voice` service was deprecated and replaced by `pinpoint-sms-voice` in builder version 8.11.0. This indicates that AWS service names can change, leading to broken imports or type errors if not tracked.
Install
-
pip install mypy-boto3-license-manager-user-subscriptions boto3
Imports
- LicenseManagerUserSubscriptionsClient
from mypy_boto3_license_manager_user_subscriptions.client import LicenseManagerUserSubscriptionsClient
- LicenseManagerUserSubscriptionsService
from mypy_boto3_license_manager_user_subscriptions.service import LicenseManagerUserSubscriptionsService
- ListUserAssociationsPaginator
from mypy_boto3_license_manager_user_subscriptions.paginator import ListUserAssociationsPaginator
Quickstart
import boto3
from mypy_boto3_license_manager_user_subscriptions.client import LicenseManagerUserSubscriptionsClient
from typing import TYPE_CHECKING
# Boto3 client without explicit type annotation (type checkers will infer)
client = boto3.client("license-manager-user-subscriptions")
client.list_user_associations() # type checks correctly
# Boto3 client with explicit type annotation
def get_license_client() -> LicenseManagerUserSubscriptionsClient:
return boto3.client("license-manager-user-subscriptions")
license_client: LicenseManagerUserSubscriptionsClient = get_license_client()
license_client.list_user_associations(InstanceId='test-instance') # type checks correctly
# Example of using a Paginator (if available for the operation)
if TYPE_CHECKING:
from mypy_boto3_license_manager_user_subscriptions.paginator import ListUserAssociationsPaginator
paginator: ListUserAssociationsPaginator = license_client.get_paginator("list_user_associations")
for page in paginator.paginate():
print(page.get('InstanceUserSummaries'))
print("mypy-boto3-license-manager-user-subscriptions setup successful!")