{"id":3597,"library":"mypy-boto3-iotfleetwise","title":"mypy-boto3-iotfleetwise type stubs","description":"mypy-boto3-iotfleetwise provides type annotations for the `boto3` AWS IoT FleetWise service, ensuring static type checking with tools like `mypy` and enhancing IDE auto-completion for `boto3` clients. It is currently at version 1.42.3, in sync with `boto3` releases, and is generated by `mypy-boto3-builder 8.12.0` which has a frequent release cadence, often aligning with new `boto3` versions.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type-hints","mypy","boto3","aws","iotfleetwise","stubs"],"install":[{"cmd":"pip install mypy-boto3-iotfleetwise boto3","lang":"bash","label":"Install stubs and runtime library"}],"dependencies":[{"reason":"Runtime dependency for the actual AWS SDK functionalities these stubs type-check.","package":"boto3","optional":false},{"reason":"Required for static type checking; these are type stubs designed for mypy.","package":"mypy","optional":true}],"imports":[{"note":"The client class for type hinting is imported directly from the stub package, not from boto3 itself, which returns a dynamically typed object.","wrong":"from boto3.client import IoTFleetWiseClient","symbol":"IoTFleetWiseClient","correct":"from mypy_boto3_iotfleetwise.client import IoTFleetWiseClient"},{"note":"Type definitions for request/response bodies are available as TypedDicts.","symbol":"CreateFleetRequestTypeDef","correct":"from mypy_boto3_iotfleetwise.type_defs import CreateFleetRequestTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_iotfleetwise.client import IoTFleetWiseClient\nfrom mypy_boto3_iotfleetwise.type_defs import CreateFleetRequestTypeDef, CreateFleetResponseTypeDef\n\ndef create_iot_fleet(fleet_id: str, fleet_description: str, tags: list[dict]) -> CreateFleetResponseTypeDef:\n    client: IoTFleetWiseClient = boto3.client(\"iotfleetwise\")\n\n    request_payload: CreateFleetRequestTypeDef = {\n        \"fleetId\": fleet_id,\n        \"description\": fleet_description,\n        \"tags\": tags,\n    }\n\n    try:\n        response: CreateFleetResponseTypeDef = client.create_fleet(**request_payload)\n        print(f\"Successfully created fleet: {response['fleetArn']}\")\n        return response\n    except client.exceptions.ConflictException:\n        print(f\"Fleet '{fleet_id}' already exists.\")\n        # Handle the case where the fleet already exists, e.g., get its details\n        return client.get_fleet(fleetId=fleet_id)\n    except Exception as e:\n        print(f\"Error creating fleet: {e}\")\n        raise\n\n# Example usage (requires AWS credentials configured)\n# Replace with actual desired values\n# try:\n#     fleet_response = create_iot_fleet(\n#         fleet_id=\"my-example-fleet\",\n#         fleet_description=\"Fleet for testing purposes\",\n#         tags=[{\"key\": \"Environment\", \"value\": \"Dev\"}]\n#     )\n#     print(f\"Fleet details: {fleet_response}\")\n# except Exception as e:\n#     print(f\"An error occurred: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to use `mypy-boto3-iotfleetwise` with a `boto3` client for the IoT FleetWise service. It explicitly types the client and uses a `TypedDict` for the request payload to ensure full static type checking during development."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher. If upgrading is not possible, explicitly install an older compatible version, e.g., `pip install mypy-boto3-iotfleetwise==1.41.0`.","message":"Python 3.8 support was removed for all `mypy-boto3` stub packages, including `mypy-boto3-iotfleetwise`, starting with `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 must upgrade to Python 3.9+ or pin an older version of the stub package.","severity":"breaking","affected_versions":">=1.42.0"},{"fix":"Ensure `mypy` is up-to-date. In most cases, this change is transparent. If issues arise, consult `mypy` and `mypy-boto3` documentation on stub discovery and PEP 561 compliance. [cite: github_release_8.12.0, 18]","message":"`mypy-boto3` packages migrated to PEP 561 compliant distribution in `mypy-boto3-builder` version 8.12.0. While this improves standard compatibility, users with highly customized `mypy` configurations or unusual import patterns might need to adjust their setup.","severity":"breaking","affected_versions":">=1.42.0"},{"fix":"Update imports and references to TypeDef names to reflect the new conventions. Review the specific service's `type_defs` module documentation for updated names.","message":"TypeDef naming conventions were changed in `mypy-boto3-builder` version 8.9.0. This includes shortening some TypeDef names (e.g., `CreateDistributionRequestRequestTypeDef` to `CreateDistributionRequestTypeDef`) and moving postfixes (e.g., `CreateDistributionExtraRequestTypeDef` to `CreateDistributionRequestExtraTypeDef`). Code explicitly importing or referencing these `TypedDict` names will break.","severity":"breaking","affected_versions":">=1.35.0 (approx, based on builder 8.9.0)"},{"fix":"Always ensure `boto3` is installed alongside `mypy-boto3-iotfleetwise` using `pip install boto3 mypy-boto3-iotfleetwise`.","message":"These packages provide only type stubs for `boto3`; they do not include the `boto3` runtime library itself. `boto3` must be installed separately for your Python code to execute successfully.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always annotate the client variable with the specific client type from the stub package, e.g., `client: IoTFleetWiseClient = boto3.client(\"iotfleetwise\")`.","message":"For optimal type inference and auto-completion, especially in certain IDEs (e.g., older VS Code setups) or when using `boto3-stubs-lite`, explicit type annotations for `boto3.client()` and `boto3.session.client()` calls are recommended.","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"}