{"id":3588,"library":"mypy-boto3-inspector-scan","title":"mypy-boto3-inspector-scan type stubs","description":"mypy-boto3-inspector-scan provides PEP 561 compatible type annotations for the `boto3` AWS SDK's Inspector Scan service. It helps enable static type checking for `boto3` code with tools like MyPy, catching potential errors before runtime. The current version is 1.42.12, generated by `mypy-boto3-builder 8.12.0`. Releases are frequent, typically mirroring `boto3` and AWS service updates.","status":"active","version":"1.42.12","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","stubs","inspector-scan"],"install":[{"cmd":"pip install mypy-boto3-inspector-scan boto3","lang":"bash","label":"Install stubs and runtime library"},{"cmd":"pip install mypy","lang":"bash","label":"Install MyPy for type checking"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK client that these stubs type-check.","package":"boto3","optional":false},{"reason":"Static type checker required to leverage the provided type annotations.","package":"mypy","optional":true}],"imports":[{"note":"This import is for type hinting purposes; the runtime client is obtained via boto3.client('inspector-scan').","symbol":"InspectorScanClient","correct":"from mypy_boto3_inspector_scan.client import InspectorScanClient"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_inspector_scan.client import InspectorScanClient\nimport os\n\n# Instantiate a boto3 client with type hints from mypy-boto3-inspector-scan\n# Ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)\n# Using os.environ.get for region to make the example safer without hardcoding\nregion = os.environ.get('AWS_REGION', 'us-east-1')\n\ntry:\n    # The type annotation 'InspectorScanClient' provides static type checking benefits\n    client: InspectorScanClient = boto3.client(\"inspector-scan\", region_name=region)\n    print(f\"Successfully created Inspector Scan client in region: {region}\")\n\n    # Example: List scans (requires appropriate IAM permissions, such as 'inspector-scan:ListScans')\n    response = client.list_scans()\n    print(\"List Scans Response (truncated for brevity):\")\n    print(response.get('scans', [])[:1]) # Print first scan if available\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure 'boto3' is installed and AWS credentials are configured correctly.\")\n    print(\"Also verify your IAM user/role has permissions for 'inspector-scan:ListScans'.\")","lang":"python","description":"Demonstrates how to initialize an `inspector-scan` client with `mypy-boto3` type annotations and make a sample API call. This code requires `boto3` to be installed and AWS credentials configured in the environment or AWS config files."},"warnings":[{"fix":"Upgrade your project's Python version to 3.9+ or constrain `mypy-boto3-inspector-scan` to a version generated by `mypy-boto3-builder < 8.12.0` (e.g., `<1.42.0`).","message":"Python 3.8 support has been removed since `mypy-boto3-builder 8.12.0`. Projects using older Python versions will need to upgrade Python or pin to an older version of `mypy-boto3-*` packages to maintain compatibility.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0 (and generated stubs)"},{"fix":"Review and update any explicit TypeDef imports and usage in your code to match the new naming conventions introduced with `mypy-boto3-builder` version 8.9.0.","message":"TypeDef naming conventions changed in builder version 8.9.0, including shorter names for packed method arguments (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`) and postfix relocation for conflicting names. This may break existing explicit type annotations in your codebase.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0 (and generated stubs)"},{"fix":"Ensure `pip install boto3` is included in your project's dependencies, in addition to the `mypy-boto3-*` stubs.","message":"These packages provide only type stubs, not the runtime implementation of the AWS SDK. `boto3` (or `aioboto3` for async) must be installed alongside `mypy-boto3-*` packages for your code to execute successfully.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Regularly update both `boto3` and `mypy-boto3-inspector-scan` to their latest compatible versions. Consider using dependency management tools (e.g., `pip-tools`, `Poetry`) to help synchronize versions.","message":"To ensure accurate type checking and prevent unexpected `mypy` errors, the version of `mypy-boto3-inspector-scan` should ideally be kept synchronized with the version of `boto3` you are using. Significant version drift can lead to outdated or incorrect type hints.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}