{"id":3602,"library":"mypy-boto3-ivschat","title":"mypy-boto3-ivschat: Type Annotations for AWS IVS Chat","description":"mypy-boto3-ivschat provides type annotations for the AWS IVS Chat service client within the boto3 library, enhancing static analysis and IDE autocomplete. It's part of the `mypy-boto3` ecosystem, which generates stubs for all AWS services. The library updates frequently, typically mirroring boto3 releases.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["AWS","boto3","mypy","type-hints","ivschat","static-analysis"],"install":[{"cmd":"pip install boto3 mypy-boto3-ivschat","lang":"bash","label":"Install `boto3` and IVS Chat stubs"}],"dependencies":[{"reason":"Runtime dependency for AWS SDK functionality. `mypy-boto3-ivschat` only provides type hints.","package":"boto3","optional":false},{"reason":"Provides backported type features for Python versions older than 3.12. Automatically installed as needed.","package":"typing-extensions","optional":false}],"imports":[{"note":"Type stubs are imported from the dedicated stub package, not directly from `boto3`.","wrong":"from boto3.client import IvschatClient","symbol":"IvschatClient","correct":"from mypy_boto3_ivschat import IvschatClient"},{"note":"All `TypedDict` definitions for service responses and request parameters reside in the `type_defs` submodule.","symbol":"ListChannelsResponseTypeDef","correct":"from mypy_boto3_ivschat.type_defs import ListChannelsResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_ivschat import IvschatClient\nfrom typing import TYPE_CHECKING\n\n# These imports are only for type checking and will be ignored at runtime\nif TYPE_CHECKING:\n    from mypy_boto3_ivschat.type_defs import ListChannelsResponseTypeDef, ChannelSummaryTypeDef\n\n\ndef get_ivs_chat_channels() -> None:\n    # Initialize a boto3 client, type-hinted by mypy-boto3-ivschat\n    client: IvschatClient = boto3.client(\"ivschat\")\n\n    print(\"Listing IVS Chat Channels...\")\n    try:\n        # Make an API call, with return type safety\n        response: ListChannelsResponseTypeDef = client.list_channels()\n\n        channels = response.get(\"channels\", [])\n        if channels:\n            print(f\"Found {len(channels)} channels:\")\n            for channel in channels:\n                # Further type-hinting for individual items\n                channel_summary: ChannelSummaryTypeDef = channel\n                print(f\"  - Name: {channel_summary.get('name')}, ARN: {channel_summary.get('arn')}\")\n        else:\n            print(\"No IVS Chat channels found.\")\n\n    except client.exceptions.ClientError as e:\n        print(f\"AWS Client Error: {e}\")\n    except Exception as e:\n        print(f\"An unexpected error occurred: {e}\")\n\nif __name__ == \"__main__\":\n    get_ivs_chat_channels()\n","lang":"python","description":"This quickstart demonstrates how to initialize a `boto3` IVS Chat client and use the `mypy-boto3-ivschat` stubs to provide accurate type hints for client methods and their return values. This significantly improves code reliability and development experience with static analysis."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or a later supported version.","message":"Support for Python 3.8 was removed starting with `mypy-boto3-builder` version 8.12.0. Ensure your project uses Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0 (affects all generated stub packages)"},{"fix":"Always install both `boto3` and `mypy-boto3-ivschat` (e.g., `pip install boto3 mypy-boto3-ivschat`).","message":"`mypy-boto3-ivschat` provides only type annotations; it does NOT include the `boto3` runtime itself. You must install `boto3` separately for your code to execute.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the `mypy-boto3` documentation or your IDE's autocomplete for the correct `TypeDef` names, especially after upgrading.","message":"Starting with `mypy-boto3-builder` 8.9.0, some `TypeDef` names were shortened (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`) or reorganized to avoid conflicts. This could lead to `NameError` if referencing old `TypeDef` names.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0 (affects generated stub packages from this version)"},{"fix":"Always use `from mypy_boto3_ivschat import ...` for type imports. The runtime `boto3.client('ivschat')` remains unchanged.","message":"For type hints, you must import types directly from `mypy_boto3_ivschat` (e.g., `from mypy_boto3_ivschat import IvschatClient`). Importing from `boto3.ivschat` or similar paths will not provide the correct static types.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update your `mypy` installation (`pip install --upgrade mypy`) if type checking issues arise after upgrading `mypy-boto3-ivschat`.","message":"The `mypy-boto3-builder` migrated to PEP 561 compliant packages in version 8.12.0. While mostly internal, ensure `mypy` is up to date to correctly discover and use these stub packages.","severity":"gotcha","affected_versions":"mypy-boto3-builder >=8.12.0"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}