{"id":3702,"library":"mypy-boto3-simspaceweaver","title":"Type Annotations for boto3 SimSpace Weaver","description":"mypy-boto3-simspaceweaver provides static type annotations for the `boto3` SimSpace Weaver service. It enhances development with `boto3` by offering compile-time type checking, auto-completion, and error detection in IDEs. The library is part of the `mypy-boto3-builder` ecosystem, which follows a frequent release cadence, often aligning with `boto3` updates. The current version, `1.42.3`, corresponds to the `boto3` version it provides stubs for.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","types","stubs","simspaceweaver","static analysis"],"install":[{"cmd":"pip install mypy-boto3-simspaceweaver","lang":"bash","label":"Install service stubs"}],"dependencies":[{"reason":"This package provides type stubs for the boto3 library's SimSpace Weaver service; boto3 itself must be installed to use the functionality.","package":"boto3","optional":false}],"imports":[{"note":"For explicit type hinting of the boto3 SimSpace Weaver client object.","symbol":"SimSpaceWeaverClient","correct":"from mypy_boto3_simspaceweaver.client import SimSpaceWeaverClient"},{"note":"For explicit type definitions of service request/response bodies, allowing stricter type checking on payload structures.","symbol":"CreateSpaceInputRequestTypeDef","correct":"from mypy_boto3_simspaceweaver.type_defs import CreateSpaceInputRequestTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_simspaceweaver.client import SimSpaceWeaverClient\nfrom mypy_boto3_simspaceweaver.type_defs import CreateSpaceInputRequestTypeDef\n\n# mypy-boto3-simspaceweaver provides type hints for the boto3 SimSpaceWeaver client.\n# It does not need to be imported directly for runtime functionality;\n# simply installing it adds type information to your boto3 usage.\n\n# Step 1: Initialize a boto3 client with type hints\n# This enables IDE autocompletion and static type checking for SimSpaceWeaver operations.\nclient: SimSpaceWeaverClient = boto3.client(\"simspaceweaver\")\n\n# Step 2: Use the client (ensure you have AWS credentials configured, e.g., via ~/.aws/credentials)\ntry:\n    # Example: List existing SimSpace Weaver spaces\n    response = client.list_spaces(MaxResults=5)\n    print(\"Successfully listed SimSpace Weaver spaces:\")\n    for space in response.get(\"Spaces\", []):\n        print(f\"- {space.get('Name')} (Status: {space.get('Status')})\")\nexcept Exception as e:\n    print(f\"Could not list spaces. Ensure AWS credentials are configured. Error: {e}\")\n\n# Step 3: Use specific TypeDefs for request/response objects for stricter type checking\n# This demonstrates type safety for a hypothetical request payload, without making an actual call.\nhypothetical_create_space_request: CreateSpaceInputRequestTypeDef = {\n    \"Name\": \"MyTestSimSpace\",\n    \"RoleArn\": \"arn:aws:iam::123456789012:role/SimSpaceWeaverRole\", # Replace with a valid ARN if performing actual calls\n    \"Description\": \"A simulated space for testing.\",\n    \"MaximumDuration\": 3600,\n    \"Tags\": {\"Project\": \"MyProject\"}\n}\nprint(\"\\nDemonstrating TypeDef for CreateSpaceInputRequestTypeDef:\")\nprint(f\"  Name: {hypothetical_create_space_request['Name']}\")\nprint(f\"  RoleArn: {hypothetical_create_space_request['RoleArn']}\")\n\n# With mypy-boto3-simspaceweaver installed, a type checker (like mypy) would\n# flag issues if 'Name' or 'RoleArn' were missing or had incorrect types.","lang":"python","description":"Demonstrates how to initialize a `boto3` client with type hints from `mypy-boto3-simspaceweaver` and use specific TypeDefs for input payloads. This enables advanced static analysis and autocompletion without altering runtime behavior."},"warnings":[{"fix":"Upgrade your Python environment to version 3.9 or newer. Ensure your build and packaging tools correctly handle PEP 561 metadata.","message":"Python 3.8 support was removed, and packages migrated to PEP 561. This affects all generated `mypy-boto3` stubs.","severity":"breaking","affected_versions":"mypy-boto3-builder 8.12.0 and higher (affecting all generated stubs)"},{"fix":"Review and update explicit TypeDef imports and references in your code to match the new naming conventions. Consult the `mypy-boto3-builder` changelog for specific changes.","message":"TypeDef names for method arguments (e.g., `CreateDistributionRequestRequestTypeDef`) were shortened or had `Extra` postfixes moved. This change can break explicit type hint references in existing code.","severity":"breaking","affected_versions":"mypy-boto3-builder 8.9.0 and higher (affecting all generated stubs)"},{"fix":"Do not `import mypy_boto3_simspaceweaver` for runtime logic. Instead, simply install the package, and type checkers will automatically pick up its type information when you use `boto3`. Only import specific TypeDefs (e.g., `SimSpaceWeaverClient`, `CreateSpaceInputRequestTypeDef`) from `mypy_boto3_simspaceweaver.*` for explicit type annotations.","message":"This package provides only type stubs and is not intended for runtime import or direct use. Its purpose is to enhance `boto3`'s static analysis capabilities.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure that your installed `mypy-boto3-simspaceweaver` package version closely matches your `boto3` library version to guarantee accurate type coverage.","message":"The version of `mypy-boto3-simspaceweaver` is designed to align with the `boto3` version it provides stubs for. Mismatching versions can lead to incorrect or missing type hints.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}