Registry /
type-stubs / mypy-boto3-globalaccelerator
Install & Compatibility
Where this runs
tested against v1.43.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.628s · 52.1MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.8s · import 0.578s · 53MB
50MB installed
● package 50MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
GlobalAcceleratorClient
✓ from mypy_boto3_globalaccelerator.client import GlobalAcceleratorClient
✗ from boto3.client import GlobalAcceleratorClient
Type hints for boto3 clients are provided by mypy-boto3, not directly from boto3.
CreateAcceleratorRequestTypeDef
✓ from mypy_boto3_globalaccelerator.type_defs import CreateAcceleratorRequestTypeDef
This quickstart demonstrates how to use `mypy-boto3-globalaccelerator` to type-hint a `boto3` GlobalAccelerator client and its method parameters. It defines a function to create a Global Accelerator, using `GlobalAcceleratorClient` for client typing and `CreateAcceleratorRequestTypeDef` for request payload typing. Remember to have `boto3` installed and AWS credentials configured to run actual AWS operations.
import boto3
from mypy_boto3_globalaccelerator.client import GlobalAcceleratorClient
from mypy_boto3_globalaccelerator.type_defs import CreateAcceleratorRequestTypeDef
import os
def create_example_accelerator(name: str) -> str:
"""Creates an AWS Global Accelerator accelerator."""
# Ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)
# The following line uses os.environ.get for illustration, boto3 handles credential lookup implicitly.
# AWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID', '')
# AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY', '')
client: GlobalAcceleratorClient = boto3.client("globalaccelerator", region_name="us-west-2")
request_payload: CreateAcceleratorRequestTypeDef = {
"Name": name,
"IpAddressType": "IPV4",
"Enabled": True,
"Tags": [
{"Key": "Project", "Value": "ChecklistDay"},
{"Key": "Environment", "Value": "Dev"}
],
}
try:
response = client.create_accelerator(**request_payload)
accelerator_arn = response["AcceleratorArn"]
print(f"Successfully created accelerator: {accelerator_arn}")
return accelerator_arn
except client.exceptions.AcceleratorLimitExceededException as e:
print(f"Error: Accelerator limit exceeded. {e}")
return ""
except Exception as e:
print(f"An unexpected error occurred: {e}")
return ""
# Example usage (requires AWS credentials and appropriate permissions)
if __name__ == "__main__":
# For a real run, ensure your AWS environment is configured.
# For testing, you might mock boto3 or ensure you have a sandbox AWS account.
# Skipping actual execution for quickstart to avoid live resource creation.
# accelerator_arn = create_example_accelerator("MyTestGlobalAccelerator")
# if accelerator_arn:
# print(f"Accelerator created with ARN: {accelerator_arn}")
print("Quickstart example demonstrates type hinting. To run, uncomment the example usage and configure AWS credentials.")
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredRuntime dependency for the actual AWS SDK client. The stubs provide types for boto3.