Registry /
type-stubs / mypy-boto3-migrationhub-config
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.95 runs
installs and imports cleanly · install 0.0s · import 0.616s · 116.4MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 6.0s · import 0.542s · 114MB
114MB installed
● package 114MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
MigrationHubConfigClient
✓ from mypy_boto3_migrationhub_config.client import MigrationHubConfigClient
✗ from mypy_boto3_migrationhub_config import MigrationHubConfigClient
Client types are nested under the '.client' submodule.
GetHomeRegionResultTypeDef
✓ from mypy_boto3_migrationhub_config.type_defs import GetHomeRegionResultTypeDef
✗ from mypy_boto3_migrationhub_config.client import GetHomeRegionResultTypeDef
Type definition objects (TypedDicts) are typically found in the '.type_defs' submodule.
This quickstart demonstrates how to instantiate a typed `MigrationHubConfigClient` and use it to retrieve the Migration Hub home region. It includes explicit type hints for `boto3.client` and for the response type, which is crucial for full static analysis and IDE autocomplete. Ensure `boto3` and `mypy-boto3-migrationhub-config` are installed, and AWS credentials are configured.
import boto3
from typing import TYPE_CHECKING, Dict, Any
from os import environ
if TYPE_CHECKING:
from mypy_boto3_migrationhub_config.client import MigrationHubConfigClient
from mypy_boto3_migrationhub_config.type_defs import GetHomeRegionResultTypeDef
def get_migrationhub_config_client() -> "MigrationHubConfigClient":
"""
Returns a typed MigrationHubConfig client.
"""
region = environ.get("AWS_REGION", "us-east-1") # Default region if not set
client: "MigrationHubConfigClient" = boto3.client("migrationhub-config", region_name=region)
return client
def describe_current_home_region():
"""
Describes the current Migration Hub home region.
"""
client = get_migrationhub_config_client()
try:
response: "GetHomeRegionResultTypeDef" = client.get_home_region()
home_region = response.get("HomeRegion")
print(f"Current Migration Hub Home Region: {home_region}")
return home_region
except client.exceptions.AccessDeniedException:
print("Access Denied: Ensure your AWS credentials are configured and have permissions for migrationhub-config:GetHomeRegion.")
return None
except Exception as e:
print(f"An unexpected error occurred: {e}")
return None
if __name__ == "__main__":
# Set AWS credentials and region via environment variables (e.g., AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION)
# or AWS CLI configuration before running.
print("Attempting to retrieve Migration Hub Home Region...")
describe_current_home_region()
Debug
Known issues
breakingSupport for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0 and subsequent package releases. Users on Python 3.8 must upgrade their Python version to 3.9 or newer.fixUpgrade Python environment to 3.9 or later.
affects: >=8.12.0 of mypy-boto3-builder (used to generate 1.42.3+)
gotchaThese packages provide type stubs for boto3; `boto3` itself must be installed separately for runtime functionality. Failing to install `boto3` will result in runtime `ModuleNotFoundError`.fixEnsure `boto3` is installed alongside `mypy-boto3-migrationhub-config` using `pip install boto3`.
affects: All versions
gotchaFor optimal static analysis and IDE autocomplete (especially in VSCode), explicitly type the `boto3.client()` call with the imported client type (e.g., `client: MigrationHubConfigClient = boto3.client(...)`). Implicit typing may not provide full benefits.fixAdd explicit type annotations to `boto3.client()` and `boto3.resource()` calls, and for method return values where appropriate.
affects: All versions
breakingIn `mypy-boto3-builder` 8.9.0, there were changes to how TypeDef names for packed method arguments are generated (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). If you were explicitly importing and using such TypeDefs, their names might have changed.fixReview your code for any explicit `TypeDef` imports and adjust names if they were affected by the shortening or postfix reordering rules.
affects: >=8.9.0 of mypy-boto3-builder (used to generate 1.42.3+)
gotchaUsing these type stubs with linters like Pylint or Flake8 can sometimes lead to 'undefined variable' or 'unused import' warnings when `TYPE_CHECKING` guards are not used. These stubs are only for static analysis, not runtime.fixWrap type stub imports and type aliases in `if TYPE_CHECKING:` blocks to make them conditional for type checkers only, avoiding linter warnings for runtime code.
affects: All versions
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredRuntime dependency for AWS SDK functionality.
mypyrequiredStatic type checker for which these stubs are provided.
pythonrequiredMinimum required Python version.