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.915 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.3MB
glibcpy 3.10–3.915 runs
installs and imports cleanly · install 3.0s · import 0.000s · 216MB
143MB installed
● package 143MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
MigrationHubClient
✓ from mypy_boto3_mgh import MigrationHubClient
✗ from mypy_boto3_mgh import MigrationHubClient
This quickstart demonstrates how to obtain a type-hinted MigrationHub client using `boto3` and `mypy-boto3-mgh`. The `TYPE_CHECKING` block is a common pattern to avoid importing stubs in production environments.
import os
import boto3
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from mypy_boto3_mgh.client import MigrationHubClient
def get_migrationhub_client() -> "MigrationHubClient":
"""
Retrieves a typed boto3 MigrationHub client.
"""
# boto3 automatically picks up credentials from environment variables,
# shared credential files, or IAM roles.
# For a quickstart, we assume credentials are set up.
session = boto3.Session(region_name=os.environ.get("AWS_REGION", "us-east-1"))
client: "MigrationHubClient" = session.client("migrationhub")
return client
if __name__ == "__main__":
# This example requires AWS credentials configured in your environment
# (e.g., AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION)
# or via ~/.aws/credentials.
# Try to get a client
mgh_client = get_migrationhub_client()
print(f"Successfully obtained MigrationHub client: {mgh_client}")
# You can now use mgh_client with full type hints, e.g.:
# response = mgh_client.list_application_states()
# print(response)
Debug
Known issues
breakingBeginning with `mypy-boto3-builder` version 8.12.0 (and consequently all generated stub packages, including `mypy-boto3-mgh` 1.42.3), Python 3.8 is no longer supported. Projects targeting Python 3.8 will fail to type-check or even install these stubs.fixUpgrade your Python environment to 3.9 or newer.
affects: >=8.12.0 of `mypy-boto3-builder` (corresponds to `mypy-boto3-mgh` versions generated by it, e.g., 1.42.3)
breakingThe `mypy-boto3-builder` (from version 8.9.0) introduced breaking changes to TypeDef naming conventions. Argument TypeDefs now use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes are moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`). This affects all generated service stubs.fixUpdate your code to use the new TypeDef names. Refer to the specific service module's documentation for exact naming, or rely on IDE auto-completion.
affects: >=8.9.0 of `mypy-boto3-builder` (corresponds to `mypy-boto3-mgh` versions generated by it, including 1.42.3)
gotchaWhile `mypy-boto3` aims for automatic type discovery, some IDEs (like VSCode) may require explicit type annotations for `boto3.client()`, `session.client()`, `.get_waiter()`, and `.get_paginator()` calls to provide full auto-completion and type checking. PyCharm users are sometimes recommended to use `mypy-boto3-lite` to avoid performance issues with `Literal` overloads.fixExplicitly annotate the return type of `boto3.client('service')` calls, e.g., `client: MigrationHubClient = boto3.client('migrationhub')`. If using PyCharm and experiencing performance issues, consider `mypy-boto3-lite` or check for IDE updates. affects: All versions
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredRuntime dependency for AWS SDK functionality. The stub package provides type hints for this library.
mypyoptionalDevelopment dependency for static type checking. Other type checkers like pyright can also be used.
pythonrequiredRequires Python 3.9 or newer.