Registry / type-stubs / mypy-boto3-globalaccelerator

mypy-boto3-globalaccelerator

JSON →
library1.43.0pypypi✓ verified 23d ago

mypy-boto3-globalaccelerator provides type annotations for the boto3 GlobalAccelerator service. It helps developers leverage static type checking with Mypy for AWS Global Accelerator clients, improving code quality and catching potential errors at development time. The current version is 1.42.3, and new versions are regularly released in sync with boto3 and botocore updates.

pip install mypy-boto3-globalaccelerator boto3
INSTALL
IMPORT
SIG · MYPY-BOTO3-GLOBALA
M
mypy-boto3-globalaccelerator
type-stubspythonv1.43.0
Install
2.8s avg
Import
603ms
Disk
50MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.628s · 52.1MB
glibc
py 3.103.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.")
Debug
Known issues
breakingPython 3.8 support was removed in `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 must upgrade to Python 3.9 or newer to continue receiving updates for `mypy-boto3-*` packages.
fix
Upgrade your Python environment to 3.9 or higher.
affects: >=8.12.0
breakingAll `mypy-boto3-*` packages migrated to PEP 561-compliant distribution in version 8.12.0. This change primarily affects how type checkers locate stubs, potentially requiring `mypy` or other tools to be updated to a version that properly handles PEP 561 packages.
fix
Ensure your Mypy version is up-to-date. If experiencing issues, verify your `pyproject.toml` or `setup.cfg` settings for `mypy`.
affects: >=8.12.0
gotchaThe `mypy-boto3-globalaccelerator` package provides type stubs for `boto3`, but does *not* install `boto3` itself. You must explicitly install `boto3` alongside the stubs package. Using `pip install mypy-boto3-globalaccelerator[globalaccelerator]` *will* install boto3, but this is an 'extra' and less explicit than installing `boto3` separately.
fix
Always ensure both `pip install boto3` and `pip install mypy-boto3-globalaccelerator` are executed.
affects: all
gotchaFor optimal type checking accuracy, the version of `mypy-boto3-globalaccelerator` should ideally match or closely align with your installed `boto3` version. Significant version discrepancies can lead to inaccurate type hints for new or changed service features.
fix
Periodically update both `boto3` and `mypy-boto3-globalaccelerator` together to their latest compatible versions.
affects: all
breakingIn `mypy-boto3-builder` version 8.9.0, type definition naming conventions changed to use shorter names where possible (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). This might break code explicitly importing the old, longer type definition names.
fix
Review your `type_defs` imports and update any affected `RequestRequestTypeDef` or `ExtraRequestTypeDef` names to their new, shorter forms (e.g., `CreateAcceleratorRequestTypeDef`).
affects: >=8.9.0
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.
Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
2
Resources