mypy-boto3-appfabric
mypy-boto3-appfabric provides type annotations for the boto3 AppFabric service, enabling static type checking for your AWS interactions. It is part of the larger mypy-boto3 project, generated by mypy-boto3-builder 8.12.0, and releases frequently to keep pace with new boto3 versions and services.
Warnings
- breaking Python 3.8 support was removed for all `mypy-boto3` packages with `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 will need to upgrade to Python 3.9+ to use the latest stubs.
- breaking The `mypy-boto3-builder` 8.9.0 release introduced changes to how TypeDef names are generated (e.g., shorter names, `Extra` postfix moved). If you were relying on specific generated TypeDef names, these may have changed.
- gotcha `mypy-boto3-appfabric` provides only type stubs. You must also install the `boto3` library for the runtime functionality.
- gotcha PyCharm users might experience slow performance with `Literal` overloads. It is recommended to use `boto3-stubs-lite` or disable PyCharm's type checker and rely on external tools like MyPy or Pyright.
- gotcha The version of `mypy-boto3-appfabric` (e.g., 1.42.3) generally aligns with the `boto3` version it provides stubs for. However, the `mypy-boto3-builder` (e.g., 8.12.0), which generates these stubs, has its own independent versioning. Breaking changes in the builder apply to all generated stub packages.
- gotcha With `mypy-boto3-builder` 8.12.0, all packages migrated to `PEP 561` for stub distribution. This might affect how some tools discover and use the type stubs if their configuration expects an older distribution method.
Install
-
pip install mypy-boto3-appfabric boto3
Imports
- AppFabricClient
from mypy_boto3_appfabric.client import AppFabricClient
- AppFabricServiceName
from mypy_boto3_appfabric.type_defs import AppFabricServiceName
Quickstart
import boto3
from mypy_boto3_appfabric.client import AppFabricClient
from os import environ
def get_appfabric_client() -> AppFabricClient:
# Ensure boto3 is configured, e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME env vars
client: AppFabricClient = boto3.client(
"appfabric",
region_name=environ.get('AWS_REGION_NAME', 'us-east-1')
)
return client
if __name__ == "__main__":
appfabric_client = get_appfabric_client()
print(f"AppFabric client created: {appfabric_client}")
# Example: List app bundles (replace with actual AppFabric operation)
try:
response = appfabric_client.list_app_bundles()
print(f"Successfully listed app bundles: {len(response.get('appBundleList', []))}")
except Exception as e:
print(f"Error listing app bundles: {e}")