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.95 runs
installs and imports cleanly · install 0.0s · import 0.580s · 51.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.8s · import 0.544s · 52MB
50MB installed
● package 50MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
DetectiveClient
✓ from mypy_boto3_detective import DetectiveClient
Imports the type for the Detective service client. Specific TypeDefs can be imported from `mypy_boto3_detective.type_defs`.
Demonstrates how to initialize a boto3 Detective client and use the provided type stubs for type-checking API responses. This example assumes `boto3` is installed and AWS credentials are configured (e.g., via environment variables).
import os
from typing import TYPE_CHECKING
import boto3
# Ensure boto3 is installed: pip install boto3
if TYPE_CHECKING:
from mypy_boto3_detective import DetectiveClient
from mypy_boto3_detective.type_defs import ListGraphsResponseTypeDef
def get_detective_client() -> DetectiveClient:
# Use environment variables or other boto3 config for credentials
return boto3.client(
"detective",
aws_access_key_id=os.environ.get("AWS_ACCESS_KEY_ID", ""),
aws_secret_access_key=os.environ.get("AWS_SECRET_ACCESS_KEY", ""),
region_name=os.environ.get("AWS_DEFAULT_REGION", "us-east-1")
)
client = get_detective_client()
try:
# Example API call with type annotation for the response
response: ListGraphsResponseTypeDef = client.list_graphs()
print("Successfully listed Detective graphs:")
for graph in response.get("GraphList", []):
print(f" - Graph ARN: {graph['Arn']}")
except Exception as e:
print(f"Error listing Detective graphs: {e}")
Debug
Known issues
breakingPython 3.8 support has been removed across all `mypy-boto3-*` packages with `mypy-boto3-builder` version 8.12.0. Projects using these stubs must target Python 3.9 or newer.fixUpgrade your project's Python interpreter to 3.9 or higher.
affects: >=8.12.0 of mypy-boto3-builder and generated packages
gotcha`mypy-boto3-detective` provides only type stubs for static analysis. The actual `boto3` library must be installed separately for your application to run at runtime. Failure to install `boto3` will result in runtime import errors.fixEnsure `boto3` is included in your project's dependencies (e.g., `pip install boto3 mypy-boto3-detective`).
affects: All versions
gotchaMismatched versions between `boto3` and `mypy-boto3-detective` can lead to incorrect or incomplete type checking. It is recommended to keep their versions aligned as closely as possible, especially after significant boto3 updates.fixRegularly update both `boto3` and `mypy-boto3-detective` to their latest compatible versions. Consult the `mypy-boto3-builder` documentation for version compatibility guidelines.
affects: All versions
gotchaType definition names generated by `mypy-boto3-builder` were shortened in version 8.9.0 (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). If upgrading from older stub versions, existing type annotations might require renaming.fixReview and update type annotation names for requests, responses, and other TypeDefs according to the new naming conventions if you encounter `NameError` or `mypy` errors related to missing types.
affects: mypy-boto3-builder >=8.9.0 and generated packages
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredmypy-boto3-detective provides type stubs for boto3; boto3 itself must be installed for runtime execution.