Install & Compatibility
Where this runs
tested against v1.43.14 · 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.610s · 51.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.9s · import 0.564s · 52MB
50MB installed
● package 50MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
PIClient
✓ from mypy_boto3_pi.client import PIClient
GetDimensionKeyDetailsResponseTypeDef
✓ from mypy_boto3_pi.type_defs import GetDimensionKeyDetailsResponseTypeDef
boto3
✓ import boto3
✗ import mypy_boto3_pi
mypy-boto3-pi provides stubs for boto3, not a separate runtime library. You import boto3 and mypy uses the stubs implicitly.
This quickstart demonstrates how to use `mypy-boto3-pi` for type-hinting your `boto3` PI client. The stubs allow `mypy` and IDEs to provide accurate type information for client methods and their return types, improving code quality and reducing runtime errors. Remember to replace placeholder values like 'your-db-instance-id' and ensure you have valid AWS credentials configured.
import boto3
from mypy_boto3_pi.client import PIClient
from mypy_boto3_pi.type_defs import GetDimensionKeyDetailsResponseTypeDef
from typing import TYPE_CHECKING
# Boto3 client without type hints (mypy will infer if stubs are installed)
client = boto3.client('pi')
print(f"Client type (runtime): {type(client)}")
# Type-hinted client for better IDE support and static analysis
pi_client: PIClient = boto3.client('pi')
# Example usage with type-hinted response
# This call requires valid AWS credentials configured (e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME env vars)
# and an existing DB instance identifier.
# Replace 'db-instance-id' with a real instance if running.
if TYPE_CHECKING:
# Define a dummy response for type checking only
dummy_response: GetDimensionKeyDetailsResponseTypeDef = {
'AlignedEndTime': '', 'AlignedStartTime': '', 'Keys': []
}
try:
response: GetDimensionKeyDetailsResponseTypeDef = pi_client.get_dimension_key_details(
ServiceType='RDS',
Identifier='your-db-instance-id',
Group='DB_INSTANCE',
GroupIdentifier='your-db-instance-id'
)
print("Successfully called get_dimension_key_details (types applied).")
# Further processing with type-hinted response
except Exception as e:
print(f"Could not call AWS PI service: {e}. Ensure 'your-db-instance-id' is valid and credentials are set.")
# Accessing fields with type safety
# if response and response['Keys']:
# print(response['Keys'][0]['Dimensions'])
Debug
Known issues
breakingPython 3.8 support has been removed. All `mypy-boto3` packages now require Python 3.9 or newer.fixUpgrade your Python environment to 3.9 or higher. For example, `pyenv install 3.9.19` or similar.
affects: mypy-boto3-builder 8.12.0+
breakingType definition (TypeDef) naming conventions were changed for consistency. For example, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`. This affects all service packages.fixReview your code for explicitly imported TypeDefs and update their names according to the new, shorter convention. Your IDE should highlight these errors.
affects: mypy-boto3-builder 8.9.0+
gotchaThis package (`mypy-boto3-pi`) provides only type stubs. It does not include the `boto3` runtime library itself. You must install `boto3` separately for your code to actually interact with AWS services.fixAlways install both `boto3` and the specific `mypy-boto3-*` stub package: `pip install boto3 mypy-boto3-pi`.
affects: All versions
gotchaService names within AWS (and thus boto3) can change or be deprecated. For example, the `sms-voice` service was removed and replaced by `pinpoint-sms-voice` (mypy-boto3-builder 8.11.0). If a service client fails to resolve types, verify its current name.fixConsult the official AWS Boto3 documentation for the current service names and use the correct string in `boto3.client('service-name')`. affects: All versions
gotchaThe `mypy-boto3` project migrated to PEP 561 compliant packages. While generally seamless, if you have complex `mypy` configurations (e.g., `MYPYPATH` environment variables) or are using older `mypy` versions, you might encounter issues with stub discovery.fixEnsure `mypy` is up-to-date (`pip install --upgrade mypy`). If issues persist, simplify your `mypy` configuration and rely on standard package installation paths.
affects: mypy-boto3-builder 8.12.0+
Upgrade
Version history
1.43.14latest on PyPI · released May 22, 2026
Audit
Dependencies
boto3requiredThis package provides type stubs for boto3; boto3 itself must be installed to use the AWS SDK functionality.