{"id":2600,"library":"mypy-boto3-dataexchange","title":"mypy-boto3-dataexchange","description":"mypy-boto3-dataexchange provides type annotations for the `boto3` AWS DataExchange service. It is part of the `types-boto3` family of packages, generated by `mypy-boto3-builder`, offering enhanced type checking and IDE auto-completion for `boto3` clients and resources. The library versions are synchronized with the corresponding `boto3` service versions, ensuring up-to-date type information.","status":"active","version":"1.42.80","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","type-hints","mypy","dataexchange","stub"],"install":[{"cmd":"pip install mypy-boto3-dataexchange boto3","lang":"bash","label":"Install with boto3"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK, which these stubs provide type hints for.","package":"boto3","optional":false},{"reason":"The primary static type checker these annotations are designed for.","package":"mypy","optional":true},{"reason":"Requires Python 3.9 or newer.","package":"python","optional":false}],"imports":[{"note":"This imports the typed client for DataExchange, enabling type-checking and auto-completion for boto3.client('dataexchange').","symbol":"DataExchangeClient","correct":"from mypy_boto3_dataexchange.client import DataExchangeClient"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from mypy_boto3_dataexchange.client import DataExchangeClient\n\n# Ensure AWS credentials are set up (e.g., via environment variables, ~/.aws/credentials)\n# For example, export AWS_ACCESS_KEY_ID='YOUR_ACCESS_KEY_ID'\n# export AWS_SECRET_ACCESS_KEY='YOUR_SECRET_ACCESS_KEY'\n# export AWS_DEFAULT_REGION='us-east-1'\n\ndef get_dataexchange_client() -> DataExchangeClient:\n    \"\"\"Returns a type-hinted DataExchange client.\"\"\"\n    client: DataExchangeClient = boto3.client(\"dataexchange\")\n    return client\n\nif __name__ == \"__main__\":\n    dataexchange_client = get_dataexchange_client()\n    print(f\"Client type: {type(dataexchange_client)}\")\n    try:\n        # Example: List your Data Exchange data sets\n        response = dataexchange_client.list_data_sets()\n        print(f\"Successfully listed {len(response.get('DataSets', []))} data sets.\")\n        # Accessing typed attributes will be auto-completed and type-checked\n        for dataset in response.get('DataSets', []):\n            print(f\"  - DataSetId: {dataset.get('DataSetId')}, Name: {dataset.get('Name')}\")\n    except Exception as e:\n        print(f\"Error listing data sets: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to obtain a type-hinted DataExchange client using `mypy-boto3-dataexchange` and perform a basic operation like listing data sets. The `TYPE_CHECKING` block ensures that the type stub is only imported during type-checking, avoiding runtime dependencies. Remember to configure your AWS credentials."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or a later version.","message":"Support for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0. Projects using `mypy-boto3-dataexchange` (and other `mypy-boto3` packages) must use Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Review and update explicit TypeDef imports and usages in your codebase according to the new naming conventions. Refer to the specific service documentation for updated TypeDef names.","message":"Version 8.9.0 of `mypy-boto3-builder` introduced breaking changes in TypeDef naming conventions. Specifically, TypeDefs for packed method arguments use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes were moved (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`). This impacts explicit type annotations.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0"},{"fix":"Consider installing the `*-lite` version of the stubs (e.g., `boto3-stubs-lite[dataexchange]`) or configure your IDE to use external type checkers like `mypy` or `pyright`.","message":"PyCharm users might experience slow performance or high CPU usage due to literal overloads. It is recommended to use `boto3-stubs-lite` packages or disable PyCharm's internal type checker and rely on `mypy` or `pyright` instead.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Implement a pattern like `if TYPE_CHECKING: from mypy_boto3_dataexchange.client import DataExchangeClient else: DataExchangeClient = object`.","message":"When using `TYPE_CHECKING` for conditional imports with `pylint`, it may complain about undefined variables in the runtime block. To avoid this, set types to `object` in the `else` branch of the `TYPE_CHECKING` block.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}