Registry /
type-stubs / mypy-boto3-storagegateway
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.000s · 20MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.5s · import 0.000s · 21MB
18MB installed
● package 18MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
StorageGatewayClient
✓ from mypy_boto3_storagegateway import StorageGatewayClient
✗ from mypy_boto3_storagegateway import StorageGatewayClient
Demonstrates how to obtain a type-hinted StorageGateway client using `boto3` and leverage the provided stubs for static analysis, including type-hinted method calls and response objects. It includes error handling for a runnable example.
import boto3
from mypy_boto3_storagegateway import StorageGatewayClient
from mypy_boto3_storagegateway.type_defs import ListGatewaysOutputTypeDef
def get_storagegateway_client() -> StorageGatewayClient:
"""Returns a typed StorageGateway client."""
# boto3.client will automatically pick up the type hints
# if mypy-boto3-storagegateway is installed.
return boto3.client("storagegateway")
# Get a type-hinted StorageGateway client
client: StorageGatewayClient = get_storagegateway_client()
try:
# Use the client with type-hinted response
response: ListGatewaysOutputTypeDef = client.list_gateways(Limit=10)
gateway_names = [g['GatewayARN'] for g in response.get('GatewayInfos', [])]
if gateway_names:
print(f"Found gateways: {', '.join(gateway_names)}")
else:
print("No gateways found.")
except Exception as e:
print(f"An error occurred: {e}")
# For authentication, ensure AWS credentials are configured (e.g., via environment variables, ~/.aws/credentials, or IAM roles)
# This quickstart assumes default credential setup.
Debug
Known issues
breakingSupport for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. If you are using `mypy-boto3-storagegateway` version 1.42.3 or newer, your projects must use Python 3.9 or higher for type checking.fixUpgrade your Python environment to 3.9 or newer. Alternatively, pin an older `mypy-boto3-storagegateway` version if Python 3.8 compatibility is critical, but this will mean using older API definitions.
affects: mypy-boto3-builder >= 8.12.0 (corresponding `mypy-boto3-storagegateway` >= 1.42.3)
breakingIn `mypy-boto3-builder` version 8.9.0, there were breaking changes to TypeDef naming conventions, specifically for packed method arguments, shortening names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). This can cause type errors if updating from significantly older versions of the stubs.fixReview your code for TypeDef names, especially those ending with 'RequestRequestTypeDef', and update them to the shorter forms. Consult the specific service's `type_defs.pyi` for current names.
affects: mypy-boto3-builder >= 8.9.0
gotchaFor optimal type checking accuracy, ensure the `mypy-boto3-storagegateway` version you install closely matches your `boto3` library version. Significant mismatches can lead to incorrect type hints or missing definitions, especially with new service features or API changes.fixKeep `mypy-boto3-storagegateway` and `boto3` updated, ideally aligning their major/minor versions. Using `boto3-stubs[storagegateway]` from `pip install boto3-stubs[storagegateway]` can help manage this by ensuring the correct `boto3` dependency for the stubs is also satisfied.
affects: All versions
gotchaThese packages provide static type annotations for `boto3`; they do not replace `boto3` itself. You must have `boto3` installed to actually run your code against AWS services.fixEnsure `boto3` is installed in your runtime environment alongside `mypy-boto3-storagegateway`. The latter is only for `mypy` or other static analysis tools.
affects: All versions
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredRequired at runtime for interacting with AWS services; these are type stubs for boto3.
mypyoptionalRequired for static type checking to utilize these stubs.