mypy-boto3-elementalinference Type Annotations
mypy-boto3-elementalinference provides type annotations for the AWS ElementalInference service for boto3. It enhances the development experience by offering static type checking, autocompletion, and refactoring support for boto3 client methods and data structures related to ElementalInference. The library is actively maintained with frequent updates, aligning with boto3 releases and schema changes, and is currently at version 1.42.56.
Warnings
- breaking Support for Python 3.8 was officially removed with `mypy-boto3-builder` version 8.12.0 and subsequent generated packages. This library now requires Python 3.9 or newer.
- breaking TypeDef naming conventions changed in `mypy-boto3-builder` version 8.9.0. Some TypeDef names for packed method arguments became shorter (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`).
- gotcha This package provides type stubs only and is a 'type-checking only' dependency (PEP 561). The actual `boto3` library must be installed separately for your code to run at runtime. Without `boto3`, you will encounter `ModuleNotFoundError` or similar runtime errors.
- deprecated The `sms-voice` service was excluded from `mypy-boto3` builds in version 8.11.0, with users advised to use `pinpoint-sms-voice` instead. While this specifically affected the `sms-voice` stub package, it highlights that service names and availability can change, potentially affecting other less common services like ElementalInference in the future.
Install
-
pip install mypy-boto3-elementalinference boto3
Imports
- ElementalInferenceClient
from mypy_boto3_elementalinference.client import ElementalInferenceClient
Quickstart
import boto3
from mypy_boto3_elementalinference.client import ElementalInferenceClient
from typing import TYPE_CHECKING
# This library provides type annotations. The actual boto3 library must be installed separately.
# During type checking (e.g., with mypy, VSCode, PyCharm), the client will be strongly typed.
# At runtime, it behaves like a standard boto3 client.
if TYPE_CHECKING:
client: ElementalInferenceClient = boto3.client("elemental-inference")
else:
client = boto3.client("elemental-inference", region_name="us-east-1")
print(f"Successfully initialized boto3 client for ElementalInference.")
print(f"Client type (for type checkers): {type(client)}")
# You can now use 'client' with type-hinting support in your IDE/type checker.
# Example: Accessing a method with type-hinting benefits
# try:
# # This is a placeholder; replace with an actual ElementalInference method
# response = client.invoke_model(ModelId="your-model-id", Body=b"{}", ContentType="application/json")
# print(f"Example call response: {response}")
# except Exception as e:
# print(f"Error during example call: {e}")