{"id":3173,"library":"mypy-boto3-workspaces-web","title":"mypy-boto3-workspaces-web type stubs","description":"mypy-boto3-workspaces-web provides type annotations for the `boto3` WorkSpacesWeb service. It is part of the `mypy-boto3` family of packages, generated by `mypy-boto3-builder`. These stubs enhance developer experience with static type checking and IDE autocomplete for `boto3` clients. The current version is 1.42.51, reflecting the `boto3` version it types, and it follows a continuous release cadence in sync with `boto3` updates.","status":"active","version":"1.42.51","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","stubs","workspaces-web","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-workspaces-web boto3 mypy","lang":"bash","label":"Install type stubs, boto3, and mypy"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK for Python, which these stubs type-check.","package":"boto3"},{"reason":"Required for static type checking of your Python code.","package":"mypy","optional":true}],"imports":[{"note":"Import the typed client for WorkSpacesWeb service.","symbol":"WorkSpacesWebClient","correct":"from mypy_boto3_workspaces_web.client import WorkSpacesWebClient"},{"note":"Import literal types for service names.","symbol":"WorkSpacesWebServiceName","correct":"from mypy_boto3_workspaces_web.literals import WorkSpacesWebServiceName"},{"note":"Import TypedDicts for request/response payloads.","symbol":"AssociateBrowserSettingsRequestTypeDef","correct":"from mypy_boto3_workspaces_web.type_defs import AssociateBrowserSettingsRequestTypeDef"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from mypy_boto3_workspaces_web.client import WorkSpacesWebClient\n    from mypy_boto3_workspaces_web.type_defs import ListBrowserSettingsResponseTypeDef\n\ndef get_workspaces_web_client() -> 'WorkSpacesWebClient':\n    \"\"\"Returns a typed boto3 WorkSpacesWeb client.\"\"\"\n    return boto3.client(\"workspaces-web\")\n\ndef list_browser_settings_typed() -> ListBrowserSettingsResponseTypeDef:\n    \"\"\"Lists WorkSpaces Web browser settings with type hints.\"\"\"\n    client: WorkSpacesWebClient = get_workspaces_web_client()\n    response = client.list_browser_settings()\n    print(f\"Found {len(response.get('browserSettings', []))} browser settings.\")\n    return response\n\nif __name__ == \"__main__\":\n    # This part requires AWS credentials configured (e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)\n    # It will attempt to call the AWS API.\n    try:\n        list_browser_settings_typed()\n    except Exception as e:\n        print(f\"An error occurred: {e}. Ensure AWS credentials are configured and WorkSpaces Web service is available.\")\n","lang":"python","description":"This quickstart demonstrates how to obtain a type-hinted `boto3` WorkSpacesWeb client and use it with `mypy-boto3-workspaces-web` stubs. It showcases importing the client type and a `TypeDef` for a response, and importantly uses `if TYPE_CHECKING:` to avoid runtime dependencies on the stub package. Remember to configure your AWS credentials for the code to run successfully."},"warnings":[{"fix":"Upgrade your Python environment to version 3.9 or newer. Ensure `mypy` is also updated to a compatible version (mypy itself dropped Python 3.8 support).","message":"Support for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0. This means `mypy-boto3-workspaces-web` generated with this builder version (and newer) will not support Python 3.8.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Ensure `mypy-boto3-workspaces-web` (or `boto3-stubs[workspaces-web]`) is installed in the same Python environment used by your type checker. Update your `mypy` version to ensure full PEP 561 compatibility.","message":"The `mypy-boto3` packages, including `mypy-boto3-workspaces-web`, migrated to PEP 561 packaging. While this improves discoverability, it might affect how older `mypy` versions or IDEs resolve stubs if not properly installed or configured.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Review your code for any explicit `TypeDef` imports and update their names according to the new convention if you are on an affected `mypy-boto3` version.","message":"TypeDef naming conventions were changed in `mypy-boto3-builder` 8.9.0. Some TypeDefs for packed method arguments or those with conflicting names were renamed (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`, and `Extra` postfix moved to end).","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0"},{"fix":"Install `boto3` using `pip install boto3`.","message":"This package only provides type stubs. You *must* also install the `boto3` library for your application to run at runtime.","severity":"gotcha","affected_versions":"All"},{"fix":"Use `from typing import TYPE_CHECKING` and wrap your `mypy_boto3_workspaces_web` imports inside `if TYPE_CHECKING:` blocks.","message":"For optimal performance and to avoid adding unnecessary runtime dependencies, it is a best practice to encapsulate `mypy-boto3` type imports within `if TYPE_CHECKING:` blocks.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}