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 · 198.8MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.7s · import 0.000s · 267MB
232MB installed
● package 232MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
InspectorClient
✓ from mypy_boto3_inspector import InspectorClient
✗ from mypy_boto3_inspector import InspectorClient
This quickstart demonstrates how to use the type stubs for the AWS Inspector client with boto3. It shows importing the client type and a specific response TypeDef, then using them to type-hint a boto3 client and its method return values. This allows MyPy to catch potential type mismatches or incorrect attribute access at compile time.
import boto3
from mypy_boto3_inspector.client import InspectorClient
from mypy_boto3_inspector.type_defs import DescribeAssessmentRunsResponseTypeDef
import os
def get_inspector_assessment_runs() -> DescribeAssessmentRunsResponseTypeDef:
# Ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)
# This example requires 'AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'AWS_REGION_NAME'
# to be set for boto3 to authenticate.
if not all(os.environ.get(key) for key in ['AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'AWS_REGION_NAME']):
print("Warning: AWS credentials not found in environment. Using default session config.")
client: InspectorClient = boto3.client("inspector")
print("Attempting to describe AWS Inspector assessment runs...")
response = client.describe_assessment_runs()
print(f"Found {len(response['assessmentRuns'])} assessment runs.")
# MyPy will now correctly type-check 'response' against DescribeAssessmentRunsResponseTypeDef
# For example, response['assessmentRuns'] is correctly typed as a list of AssessmentRunTypeDef
return response
if __name__ == "__main__":
try:
result = get_inspector_assessment_runs()
# You can now safely access typed attributes
if result['assessmentRuns']:
print(f"First assessment run ARN: {result['assessmentRuns'][0]['arn']}")
except Exception as e:
print(f"An error occurred: {e}")
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
typing-extensionsrequiredRequired for advanced type features, especially on older Python versions.
boto3-stubs-corerequiredProvides core boto3 type definitions that this service stub builds upon.
boto3optionalThis package provides type stubs; boto3 is required at runtime to execute AWS API calls.
mypyoptionalRequired to perform static type checking of your Python code against the provided stubs.