Registry /
type-stubs / mypy-boto3-application-insights
Install & Compatibility
Where this runs
tested against v1.43.56 · 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.590s · 51.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.9s · import 0.566s · 52MB
50MB installed
● package 50MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ApplicationInsightsClient
✓ from mypy_boto3_application_insights import ApplicationInsightsClient
✗ from types_boto3_application_insights import ApplicationInsightsClient
Old package naming convention (types-boto3-*) is deprecated in favor of mypy-boto3-*.
ApplicationInsightsClient
✓ from mypy_boto3_application_insights.client import ApplicationInsightsClient
This explicit import from 'client' module is also correct and often used under TYPE_CHECKING.
ListApplicationsOutputTypeDef
✓ from mypy_boto3_application_insights.type_defs import ListApplicationsOutputTypeDef
TypeDefs for request/response structures are located in the 'type_defs' submodule.
This quickstart demonstrates how to set up and use `mypy-boto3-application-insights` to get type hints for your `boto3` Application Insights client. It includes conditional imports (`if TYPE_CHECKING:`) for optimal runtime performance and illustrates basic client instantiation and interaction with type-checked responses. Remember to have `boto3` installed for runtime execution.
import boto3
import os
from typing import TYPE_CHECKING
# Ensure boto3 and mypy-boto3-application-insights are installed:
# pip install boto3 mypy-boto3-application-insights
if TYPE_CHECKING:
# These imports are only for type checking and will not be executed at runtime.
from mypy_boto3_application_insights import ApplicationInsightsClient
from mypy_boto3_application_insights.type_defs import (
ListApplicationsOutputTypeDef,
ApplicationTypeDef,
)
# Instantiate a boto3 client.
# mypy-boto3 provides the type hints for this client.
client: "ApplicationInsightsClient" = boto3.client(
"application-insights",
region_name=os.environ.get("AWS_REGION", "us-east-1"),
# The following are placeholder values for demonstration; use actual credentials.
aws_access_key_id=os.environ.get("AWS_ACCESS_KEY_ID", "MOCK_KEY"),
aws_secret_access_key=os.environ.get("AWS_SECRET_ACCESS_KEY", "MOCK_SECRET"),
aws_session_token=os.environ.get("AWS_SESSION_TOKEN", "MOCK_TOKEN")
)
print(f"Boto3 client instantiated (runtime type: {type(client)}).")
# Example usage with type-checked response and error handling
try:
# The response variable will be type-hinted as ListApplicationsOutputTypeDef
response: "ListApplicationsOutputTypeDef" = client.list_applications()
# Access type-hinted data from the response
applications: list["ApplicationTypeDef"] = response.get("ApplicationInfoList", [])
print(f"Found {len(applications)} Application Insights applications.")
if applications:
print(f"First application name: {applications[0]['ApplicationName']}")
except client.exceptions.ResourceNotFoundException:
print("No Application Insights applications found or insufficient permissions.")
except Exception as e:
print(f"An unexpected error occurred: {e}")
Upgrade
Version history
1.43.56latest on PyPI · released Jul 24, 2026
Audit
Dependencies
No dependency data recorded yet.