Install & Compatibility
Where this runs
tested against v1.43.64 · 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.758s · 52.5MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.7s · import 0.676s · 53MB
51MB installed
● package 51MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Inspector2Client
✓ from mypy_boto3_inspector2.client import Inspector2Client
✗ from boto3.client import Inspector2
Type annotations should be imported from the specific `mypy_boto3_inspector2` package, not directly from `boto3`.
ListFindingsFilterTypeDef
✓ from mypy_boto3_inspector2.type_defs import ListFindingsFilterTypeDef
✗ from boto3.types.inspector2 import ListFindingsFilter
TypedDicts and other service-specific type definitions are located in the `type_defs` submodule of `mypy_boto3_inspector2`.
This quickstart demonstrates how to use `mypy-boto3-inspector2` to add type annotations to your boto3 Inspector2 client. It shows importing the `Inspector2Client` type and a `TypeDef` for filtering, ensuring that your client calls and parameter structures are type-checked by MyPy.
import boto3
from mypy_boto3_inspector2.client import Inspector2Client
from mypy_boto3_inspector2.type_defs import ListFindingsFilterTypeDef
def get_inspector2_findings(region: str) -> None:
# Initialize a boto3 client with type annotations
client: Inspector2Client = boto3.client("inspector2", region_name=region)
# Define a filter using a TypedDict for type safety
filters: ListFindingsFilterTypeDef = {
"findingStatus": {"comparison": "EQUALS", "value": "ACTIVE"}
}
print(f"Listing active Inspector2 findings in {region}...")
try:
response = client.list_findings(filter=filters, maxResults=5)
for finding in response.get("findings", []):
print(f" Finding ARN: {finding.get('findingArn')}, Status: {finding.get('status')}")
print(f"Total findings listed: {len(response.get('findings', []))}")
except client.exceptions.ClientError as e:
print(f"Error listing findings: {e}")
# Example usage (ensure AWS credentials are configured or in environment)
if __name__ == "__main__":
get_inspector2_findings("us-east-1")
Debug
Known issues
breakingPython 3.8 support has been removed for `mypy-boto3-builder` generated packages as of version 8.12.0. Users on Python 3.8 must upgrade to Python 3.9 or newer to receive updates.fixUpgrade your Python environment to 3.9 or a later version.
affects: >=8.12.0 (builder), all generated stubs since then
breakingTypeDefs for method arguments or conflicting names might have been renamed in `mypy-boto3-builder` version 8.9.0 to use shorter names or move 'Extra' suffixes. For example, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`.fixIf you directly import specific `TypeDef` classes, check the `type_defs.pyi` file for the correct, potentially shorter, names.
affects: >=8.9.0 (builder), potentially affecting specific `TypeDef` imports in generated stubs.
gotchaThe `mypy-boto3` ecosystem migrated to PEP 561 compliant packages with `mypy-boto3-builder` version 8.12.0. While `mypy` itself should handle this seamlessly, some other type checkers or tooling might have expected older stub distribution formats.fixEnsure your type-checking tools and environment are up-to-date and compatible with PEP 561 package distribution. This is generally handled automatically by `pip` and `mypy`.
affects: >=8.12.0 (builder), all generated stubs since then
gotchaThis library provides *only* type annotations. You must install `boto3` separately to get the actual AWS SDK functionality.fixEnsure both `boto3` and `mypy-boto3-inspector2` are installed: `pip install boto3 mypy-boto3-inspector2`.
affects: All versions
gotchaService names can change over time within the AWS ecosystem (e.g., `sms-voice` became `pinpoint-sms-voice`). While `inspector2` is stable, be aware that other `mypy-boto3` service packages might require updates if the underlying AWS service name changes.fixAlways refer to the latest `mypy-boto3` documentation or PyPI for the correct package and import paths if a service is not found or has unexpected behavior.
affects: All versions (general `mypy-boto3` concern)
Upgrade
Version history
1.43.64latest on PyPI · released Aug 4, 2026
Audit
Dependencies
boto3requiredThis library provides type annotations for the boto3 library. boto3 itself must be installed to use the AWS SDK functionality.