{"id":3599,"library":"mypy-boto3-iotsitewise","title":"mypy-boto3-iotsitewise Type Stubs","description":"mypy-boto3-iotsitewise provides PEP 561 compliant type annotations for the AWS boto3 IoTSiteWise service, generated by the mypy-boto3-builder. It enhances type checking for `boto3.client('iotsitewise')` calls, enabling robust static analysis with tools like mypy and pyright, and improving IDE auto-completion. This library is actively maintained, with versions closely synchronized with upstream 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 checking","IoT","IoTSiteWise","stubs"],"install":[{"cmd":"pip install mypy-boto3-iotsitewise","lang":"bash","label":"Install standalone stubs"},{"cmd":"pip install 'boto3-stubs[iotsitewise]'","lang":"bash","label":"Install as part of boto3-stubs (recommended for multiple services)"}],"dependencies":[{"reason":"This package provides type stubs for the boto3 library's IoTSiteWise client.","package":"boto3","optional":false},{"reason":"Requires Python 3.9 or newer due to removal of Python 3.8 support in mypy-boto3-builder 8.12.0.","package":"python","optional":false}],"imports":[{"note":"For full type checking and IDE support, explicitly import the client type from the service-specific stub package. Without it, mypy will treat the client as a generic `botocore.client.BaseClient`.","wrong":"import boto3\nclient = boto3.client(\"iotsitewise\") # No type checking without explicit import or generic stubs","symbol":"IoTSiteWiseClient","correct":"from mypy_boto3_iotsitewise.client import IoTSiteWiseClient\nimport boto3\n\nclient: IoTSiteWiseClient = boto3.client(\"iotsitewise\")"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_iotsitewise.client import IoTSiteWiseClient\n\ndef get_iotsitewise_client() -> IoTSiteWiseClient:\n    \"\"\"Get a type-hinted AWS IoT SiteWise client.\"\"\"\n    # Ensure AWS credentials are set up (e.g., via environment variables or ~/.aws/credentials)\n    client: IoTSiteWiseClient = boto3.client(\n        \"iotsitewise\",\n        region_name=\"us-east-1\", # Replace with your desired region\n        aws_access_key_id='YOUR_ACCESS_KEY' or os.environ.get('AWS_ACCESS_KEY_ID', ''),\n        aws_secret_access_key='YOUR_SECRET_KEY' or os.environ.get('AWS_SECRET_ACCESS_KEY', ''),\n        aws_session_token='YOUR_SESSION_TOKEN' or os.environ.get('AWS_SESSION_TOKEN', '')\n    )\n    return client\n\nif __name__ == \"__main__\":\n    # Example usage: list assets (requires appropriate permissions)\n    try:\n        iotsitewise_client = get_iotsitewise_client()\n        response = iotsitewise_client.list_assets(maxResults=5)\n        print(\"Successfully retrieved IoT SiteWise assets:\")\n        for asset in response.get(\"assetSummaries\", []):\n            print(f\"  - {asset['name']} (ID: {asset['id']})\")\n    except Exception as e:\n        print(f\"Error interacting with IoT SiteWise: {e}\")","lang":"python","description":"This example demonstrates how to obtain a type-hinted IoTSiteWise client using `boto3` and `mypy-boto3-iotsitewise` for improved static analysis. It includes placeholder credential handling for a runnable example."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 or older must upgrade to Python 3.9+ to use packages generated by this builder (including `mypy-boto3-iotsitewise` versions built with 8.12.0+).","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Ensure your environment and type checker are updated to support PEP 561. Reinstalling the stub package might be necessary.","message":"The `mypy-boto3-builder` migrated to PEP 561 compliant package structure in version 8.12.0. This change might affect how some build systems or older type checkers locate or process the stub packages.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Review and update any explicit TypeDef references in your codebase to match the new naming conventions.","message":"TypeDef naming conventions changed in `mypy-boto3-builder` 8.9.0. Specifically, redundant 'Request' suffixes were removed (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and 'Extra' postfixes were moved (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`). While the example refers to `Distribution`, this is a general change that may affect explicit references to generated TypeDefs for IoTSiteWise.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0"},{"fix":"Prefer `boto3-stubs` with extras if using multiple AWS services, or standalone packages for single-service projects, and ensure you don't install both for the same service.","message":"The `mypy-boto3` ecosystem offers both standalone service packages (e.g., `mypy-boto3-iotsitewise`) and a consolidated `boto3-stubs` package with service-specific extras (e.g., `boto3-stubs[iotsitewise]`). Installing both for the same service can lead to conflicts or larger-than-necessary dependency graphs. Choose one method.","severity":"gotcha","affected_versions":"All"},{"fix":"Always provide explicit type annotations (e.g., `client: IoTSiteWiseClient = session.client(\"iotsitewise\")`) when using `boto3-stubs-lite` or individual `-lite` stub packages.","message":"If using `boto3-stubs-lite` (a more RAM-friendly variant), explicit type annotations for `session.client` and `session.resource` calls are *required* because it does not provide overloads for auto-discovery, unlike the full `boto3-stubs` or `mypy-boto3-` standalone packages.","severity":"gotcha","affected_versions":"All (when using -lite variants)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}