{"id":3101,"library":"mypy-boto3-imagebuilder","title":"mypy-boto3-imagebuilder type stubs","description":"mypy-boto3-imagebuilder provides type annotations for the boto3 AWS Imagebuilder service, enabling static type checking with tools like mypy. It's part of the `mypy-boto3` family of packages, generated by `mypy-boto3-builder`. The package version (1.42.88) aligns with the boto3 version it provides stubs for, and new releases are published regularly to match boto3 updates and builder improvements.","status":"active","version":"1.42.88","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["AWS","boto3","mypy","type checking","stubs","Imagebuilder","type hints"],"install":[{"cmd":"pip install mypy-boto3-imagebuilder boto3 botocore","lang":"bash","label":"Install stubs and runtime dependencies"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK for Python, which these stubs type-check.","package":"boto3","optional":false},{"reason":"Core dependency for boto3, providing fundamental types and functionality.","package":"botocore","optional":false}],"imports":[{"symbol":"ImagebuilderClient","correct":"from mypy_boto3_imagebuilder.client import ImagebuilderClient"},{"note":"Type definitions (like 'TypeDef' suffixed types) are found in `type_defs`, not `service_resource` or `client` modules.","wrong":"from mypy_boto3_imagebuilder.service_resource import ImageStateTypeDef","symbol":"ImageStateTypeDef","correct":"from mypy_boto3_imagebuilder.type_defs import ImageStateTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_imagebuilder.client import ImagebuilderClient\nfrom mypy_boto3_imagebuilder.type_defs import ImageSummaryTypeDef\n\n# Instantiate a typed client\nclient: ImagebuilderClient = boto3.client(\"imagebuilder\")\n\n# Use the client with type-checking benefits\ntry:\n    response = client.list_images(filters=[\n        {\n            'name': 'name',\n            'values': ['example-image-name']\n        }\n    ])\n\n    print(f\"Found {len(response.get('imageSummaryList', []))} images.\")\n\n    # Example of accessing a typed item\n    if response.get('imageSummaryList'):\n        first_image: ImageSummaryTypeDef = response['imageSummaryList'][0]\n        print(f\"First image ARN: {first_image['arn']}\")\n\nexcept client.exceptions.ClientError as e:\n    print(f\"An AWS error occurred: {e}\")\nexcept Exception as e:\n    print(f\"An unexpected error occurred: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to instantiate a type-hinted AWS Imagebuilder client using `boto3` and `mypy-boto3-imagebuilder` stubs. It then performs a `list_images` operation and accesses typed response data, showcasing how the stubs provide autocompletion and static type validation for client methods and response structures."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Support for Python 3.8 has been removed. All `mypy-boto3` packages, including `mypy-boto3-imagebuilder`, now require Python 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0 of `mypy-boto3-builder` generated packages"},{"fix":"Ensure your `mypy` configuration correctly points to your virtual environment or site-packages. Reinstalling the stubs might resolve discovery issues if encountered.","message":"Packages have migrated to PEP 561, which changes how `mypy` and other type checkers discover stub files. While generally backwards compatible, specific `mypy` configurations or custom stub paths might need adjustment.","severity":"breaking","affected_versions":">=8.12.0 of `mypy-boto3-builder` generated packages"},{"fix":"Consult the `mypy-boto3-builder` release notes for version 8.9.0 or higher, and update your code to use the new `TypeDef` names where applicable (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`).","message":"Specific `TypeDef` names for method arguments and conflicting definitions were shortened or renamed, potentially breaking code that explicitly referenced these type definitions.","severity":"breaking","affected_versions":">=8.9.0 of `mypy-boto3-builder` generated packages"},{"fix":"Always install `boto3` and `botocore` alongside `mypy-boto3-imagebuilder` (e.g., `pip install mypy-boto3-imagebuilder boto3 botocore`).","message":"`mypy-boto3-imagebuilder` provides type stubs only. It is not a standalone library and requires `boto3` and `botocore` to be installed for runtime functionality.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Periodically update `mypy-boto3-imagebuilder` to match your `boto3` version (e.g., `pip install --upgrade mypy-boto3-imagebuilder`).","message":"For optimal type-checking accuracy, the version of `mypy-boto3-imagebuilder` should ideally match the major and minor version of your installed `boto3` library.","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"}