{"id":3102,"library":"mypy-boto3-iot-data","title":"mypy-boto3-iot-data","description":"mypy-boto3-iot-data provides type annotations for the `boto3` IoTDataPlane service, enhancing developer experience with static type checking, auto-completion, and error prevention in IDEs like VSCode and PyCharm. It is generated by `mypy-boto3-builder` and is currently at version 1.42.3, corresponding to boto3 version 1.42.3. The `mypy-boto3` project actively maintains these stubs with frequent updates following `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-hinting","stubs","IoTDataPlane","cloud"],"install":[{"cmd":"pip install mypy-boto3-iot-data boto3","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Provides the underlying AWS SDK runtime functionality that these stubs type-hint.","package":"boto3","optional":false},{"reason":"Requires Python 3.9 or higher.","package":"python","optional":false}],"imports":[{"note":"This is the primary client type to annotate boto3.client('iot-data').","symbol":"IoTDataPlaneClient","correct":"from mypy_boto3_iot_data.client import IoTDataPlaneClient"},{"note":"Type definitions for service requests and responses are found in `type_defs`.","symbol":"PublishRequestRequestTypeDef","correct":"from mypy_boto3_iot_data.type_defs import PublishRequestRequestTypeDef"},{"note":"Recommended for avoiding runtime dependency on stubs by only importing them during type checking.","symbol":"TYPE_CHECKING","correct":"from typing import TYPE_CHECKING"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\nimport os\n\nif TYPE_CHECKING:\n    from mypy_boto3_iot_data.client import IoTDataPlaneClient\n    from mypy_boto3_iot_data.type_defs import PublishRequestRequestTypeDef\n\nAWS_REGION = os.environ.get('AWS_REGION', 'us-east-1')\n\ndef get_iot_data_client() -> 'IoTDataPlaneClient':\n    \"\"\"Returns a type-hinted IoTDataPlane client.\"\"\"\n    # Actual runtime client is from boto3\n    return boto3.client('iot-data', region_name=AWS_REGION)\n\nclient = get_iot_data_client()\n\n# Example of a type-hinted request payload\npublish_payload: 'PublishRequestRequestTypeDef' = {\n    'topic': 'my/test/topic',\n    'qos': 0,\n    'payload': b'Hello from mypy-boto3-iot-data!',\n}\n\ntry:\n    # mypy will now provide type checking for 'publish' arguments\n    response = client.publish(**publish_payload)\n    print(f\"Successfully published message. Response: {response}\")\nexcept Exception as e:\n    print(f\"Error publishing message: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to initialize a type-hinted `IoTDataPlaneClient` using `boto3` and perform a `publish` operation. The `TYPE_CHECKING` guard is used to ensure the stub imports are only active during static analysis, preventing runtime dependencies. Type definitions for request payloads (like `PublishRequestRequestTypeDef`) enhance type safety."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Python 3.8 support has been removed since `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 or older must upgrade to Python 3.9+ to use newer versions of these stubs.","severity":"breaking","affected_versions":">=8.12.0 (builder)"},{"fix":"Review and update `TypeDef` import paths and names in your codebase according to the new conventions.","message":"Breaking changes were introduced in `mypy-boto3-builder` version 8.9.0 regarding `TypeDef` naming conventions. Request TypeDefs for packed arguments now use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). Conflicting `TypeDef` `Extra` postfixes were also moved. This may require updating existing type hints.","severity":"breaking","affected_versions":">=8.9.0 (builder)"},{"fix":"Typically, `mypy` automatically finds PEP 561 packages if installed in the same environment. Verify your `mypy` configuration (e.g., no `--no-site-packages`) and ensure `mypy-boto3-iot-data` is correctly installed in your virtual environment.","message":"The `mypy-boto3` project migrated to PEP 561 compliant packages with `mypy-boto3-builder` version 8.12.0. While this generally improves compatibility with type checkers, ensure your `mypy` setup is configured to find installed stub packages, and you are running `mypy` in the same Python environment where `mypy-boto3-iot-data` is installed.","severity":"gotcha","affected_versions":">=8.12.0 (builder)"},{"fix":"To fix this, set all types to `object` in the non-`TYPE_CHECKING` branch (as shown in the quickstart example) or configure `pylint` to ignore these specific warnings.","message":"When using `mypy-boto3` with `pylint`, you might encounter false positives regarding undefined variables if you use `TYPE_CHECKING` for conditional imports.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}