Type annotations for boto3 Outposts
Type annotations for boto3 Outposts 1.42.86 service generated with mypy-boto3-builder 8.12.0. This library provides static type checking for AWS boto3 clients, resources, paginators, and waiters, enhancing developer experience with auto-completion and early error detection in IDEs and with type checkers like mypy and pyright.
Warnings
- breaking Python 3.8 support was removed in `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 or older must upgrade their Python version to >=3.9 or use an older version of `mypy-boto3-outposts` and its builder.
- breaking Breaking changes to `TypeDef` names occurred in `mypy-boto3-builder` version 8.9.0. Packed method arguments now use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes were moved (e.g., `CreateDistributionExtraRequestTypeDef` to `CreateDistributionRequestExtraTypeDef`).
- gotcha The `mypy-boto3` ecosystem migrated to PEP 561 compliant stub-only packages starting with `mypy-boto3-builder` 8.12.0. This means `mypy` will typically auto-discover types if the packages are installed, but users should be aware that `MYPYPATH` is not used for stub-only packages and direct installation is necessary for type checkers to find them.
- deprecated A pattern of service renaming/deprecation exists within the `mypy-boto3` ecosystem. For example, the `sms-voice` service was deprecated in favor of `pinpoint-sms-voice` in builder 8.11.0. While specific to `sms-voice`, this indicates that users should periodically check release notes for service-specific stub deprecations or renames.
- gotcha The legacy `mypy-boto3` package was moved to a separate product starting in `mypy-boto3-builder` 8.9.0 and is no longer generated alongside `boto3-stubs`. Users upgrading from older `mypy-boto3` installations might need to adjust their package names or rebuild their stubs.
Install
-
pip install mypy-boto3-outposts
Imports
- OutpostsClient
from mypy_boto3_outposts.client import OutpostsClient
- CreateOutpostInputRequestTypeDef
from mypy_boto3_outposts.type_defs import CreateOutpostInputRequestTypeDef
Quickstart
import boto3
from mypy_boto3_outposts.client import OutpostsClient
def get_outposts_client() -> OutpostsClient:
"""Returns a type-hinted Outposts client."""
client: OutpostsClient = boto3.client("outposts")
return client
if __name__ == "__main__":
outposts_client = get_outposts_client()
try:
# Example: List outposts
response = outposts_client.list_outposts()
print(f"Found {len(response.get('Outposts', []))} Outposts.")
if response.get('Outposts'):
print(f"First Outpost ARN: {response['Outposts'][0]['OutpostArn']}")
except Exception as e:
print(f"An error occurred: {e}")