Registry / type-stubs / mypy-boto3-inspector

mypy-boto3-inspector

JSON →
library1.43.0pypypi✓ verified 22d ago

mypy-boto3-inspector provides PEP 561 compliant type annotations (stubs) for the AWS Inspector service client in boto3, enabling static type checking with tools like MyPy. It is part of the `mypy-boto3-builder` ecosystem, which generates stubs for all AWS services. The library is actively maintained with frequent updates following boto3 and AWS API changes.

pip install mypy-boto3-inspector
INSTALL
IMPORT
SIG · MYPY-BOTO3-INSPECT
M
mypy-boto3-inspector
type-stubspythonv1.43.0
Install
3.7s avg
Import
Disk
232MB
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.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 198.8MB
glibc
py 3.103.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}")
Debug
Known issues
breakingSupport for Python 3.8 was removed in version 8.12.0 of the `mypy-boto3-builder` ecosystem, affecting all generated stub packages.
fix
Upgrade your Python environment to 3.9 or higher. (The `mypy-boto3-inspector` package version itself reflects the builder version it was generated with).
affects: >=8.12.0
breakingTypeDef naming conventions changed in version 8.9.0, specifically for packed method arguments (shorter names) and conflicting `Extra` postfixes (moved to end). This can break existing type hints.
fix
Review and update any custom type hints that reference specific `TypeDef` names. Consult the `mypy-boto3` documentation or regenerate stubs if you encounter `NameError` for TypeDefs.
affects: >=8.9.0
gotcha`mypy-boto3-inspector` provides *type stubs only*. You must install `boto3` separately for your code to execute against the actual AWS API.
fix
Ensure `pip install boto3` is part of your project's dependencies.
affects: All versions
gotchaAWS service names can sometimes change or be deprecated within the `mypy-boto3` ecosystem (e.g., `sms-voice` became `pinpoint-sms-voice`). While `inspector` is stable, always check release notes for your specific service if imports or package names stop working.
fix
If your service's stubs fail to import or build, consult the latest `mypy-boto3-builder` release notes on GitHub and PyPI for potential service name changes or deprecations, and update your `pip install` commands and import paths accordingly.
affects: All versions
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.
Agent activity
11 hits · last 30 days
node
10
Resources
mypy-boto3-inspector — pip install mypy-boto3-inspector · libregistry