Registry /
type-stubs / mypy-boto3-lexv2-models
Install & Compatibility
Where this runs
tested against v1.43.5 · 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.774s · 52.5MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.0s · import 0.722s · 53MB
51MB installed
● package 51MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
LexModelsV2Client
✓ from mypy_boto3_lexv2_models import LexModelsV2Client
LexModelsV2Client
✓ from mypy_boto3_lexv2_models.client import LexModelsV2Client
Paginator
✓ from mypy_boto3_lexv2_models.paginator import ListBotsPaginator
Paginator types are specific to each paginable operation.
Waiter
✓ from mypy_boto3_lexv2_models.waiter import BotLocaleBuiltWaiter
Waiter types are specific to each waitable operation.
TypedDict
✓ from mypy_boto3_lexv2_models.type_defs import BotSummaryTypeDef
Type definitions for API request/response structures are found in `type_defs`.
Literal
✓ from mypy_boto3_lexv2_models.literals import BotStatusType
Literal types for string-based enums are found in `literals`.
This example demonstrates how to obtain a type-hinted `LexModelsV2Client` using `boto3` and then use it to list Lex V2 bots. It leverages `TYPE_CHECKING` for conditional import of the stub types, ensuring they are only used during static analysis.
import boto3
from typing import TYPE_CHECKING
import os
if TYPE_CHECKING:
from mypy_boto3_lexv2_models import LexModelsV2Client
from mypy_boto3_lexv2_models.type_defs import BotSummaryTypeDef
def get_lexv2_client() -> 'LexModelsV2Client':
"""Returns a type-hinted LexModelsV2 client."""
# Ensure AWS credentials are set up (e.g., via environment variables or ~/.aws/credentials)
# Using os.environ.get for demonstration purposes in a runnable quickstart.
# In a real application, boto3 will find credentials automatically.
if not os.environ.get('AWS_ACCESS_KEY_ID'):
print("Warning: AWS_ACCESS_KEY_ID not set. This example may fail without credentials.")
return boto3.client("lexv2")
def list_all_lex_bots():
client = get_lexv2_client()
print("Listing Lex V2 bots...")
try:
response = client.list_bots(sortBy={
'attribute': 'BotName',
'order': 'Ascending'
})
bots: list['BotSummaryTypeDef'] = response['botSummaries']
if bots:
for bot in bots:
print(f" Bot Name: {bot['botName']}, Status: {bot['botStatus']}")
else:
print(" No Lex V2 bots found.")
except Exception as e:
print(f"Error listing bots: {e}")
if __name__ == "__main__":
list_all_lex_bots()
Debug
Known issues
breakingSupport for Python 3.8 was removed in `mypy-boto3-builder 8.12.0`, which generates this package. Ensure your environment uses Python 3.9 or newer.fixUpgrade your Python interpreter to version 3.9 or higher.
affects: mypy-boto3-builder >= 8.12.0
breakingSome generated `TypeDef` names were shortened in `mypy-boto3-builder 8.9.0`. For example, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`.fixUpdate your code to use the new, shorter `TypeDef` names where applicable. Review your type hint usage for affected services.
affects: mypy-boto3-builder >= 8.9.0
gotchaThis package provides only type annotations and does not include the actual `boto3` runtime library. `boto3` must be installed separately for your application to function at runtime.fixEnsure `boto3` is included in your project's dependencies (e.g., `pip install boto3`).
affects: all
gotchaFor Pylint compatibility and to avoid runtime dependencies on stub packages, it is recommended to conditionally import type hints using `if TYPE_CHECKING: ... else: ...` blocks.fixWrap type stub imports within `if TYPE_CHECKING:` blocks, and optionally define fallback `object` types for runtime if strict Pylint rules are enabled.
affects: all
Upgrade
Version history
1.43.5latest on PyPI · released May 6, 2026
Audit
Dependencies
boto3requiredProvides the AWS SDK for Python, which this library annotates. This stub library does not provide runtime functionality itself.
mypyoptionalStatic type checker used to validate type annotations.