Registry / type-stubs / mypy-boto3-detective

mypy-boto3-detective

JSON →
library1.43.0pypypi✓ verified 22d ago

mypy-boto3-detective provides type annotations for the AWS boto3 Detective service, enhancing static analysis for Python applications using mypy. It's part of the `mypy-boto3-builder` project, which generates stubs for all boto3 services. The library receives frequent updates, typically aligning with new boto3 and botocore releases to ensure up-to-date type definitions.

pip install mypy-boto3-detective boto3
INSTALL
IMPORT
SIG · MYPY-BOTO3-DETECTI
M
mypy-boto3-detective
type-stubspythonv1.43.0
Install
3.8s avg
Import
562ms
Disk
50MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.580s · 51.9MB
glibc
py 3.103.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.
fix
Upgrade 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.
fix
Ensure `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.
fix
Regularly 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.
fix
Review 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.
Agent activity
14 hits · last 30 days
node
10
OpenAI (training)
2
Resources
mypy-boto3-detective — pip install mypy-boto3-detective · libregistry