{"id":3606,"library":"mypy-boto3-keyspacesstreams","title":"mypy-boto3-keyspacesstreams Type Annotations","description":"mypy-boto3-keyspacesstreams provides type annotations for the `boto3` library's KeyspacesStreams service, enabling static type checking with tools like MyPy. It is part of the `mypy-boto3` project, which generates stubs for all AWS services supported by `boto3`. The current version is 1.42.59, generated by `mypy-boto3-builder 8.12.0`, with frequent updates to align with `boto3` releases.","status":"active","version":"1.42.59","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","types","keyspaces","streams","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-keyspacesstreams","lang":"bash","label":"Install package"}],"dependencies":[{"reason":"Provides the runtime AWS SDK that these type stubs describe. Must be installed separately.","package":"boto3","optional":false}],"imports":[{"note":"Import the specific client type for type hinting.","symbol":"KeyspacesStreamsClient","correct":"from mypy_boto3_keyspacesstreams.client import KeyspacesStreamsClient"},{"note":"Import specific TypedDicts for detailed response type hinting.","symbol":"ListStreamsOutputTypeDef","correct":"from mypy_boto3_keyspacesstreams.type_defs import ListStreamsOutputTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_keyspacesstreams.client import KeyspacesStreamsClient\nfrom typing import TYPE_CHECKING\n\n# The actual boto3 client is not affected by the stub package at runtime.\n# Type checking tools like MyPy will use the imported KeyspacesStreamsClient for analysis.\n\n# It's good practice to guard stub imports if they might not be available at runtime\n# in some environments, though mypy-boto3 stubs are typically installed alongside boto3.\nif TYPE_CHECKING:\n    client: KeyspacesStreamsClient = boto3.client(\"keyspaces-streams\")\nelse:\n    client = boto3.client(\"keyspaces-streams\")\n\n# Example operation: list streams (ensure your AWS credentials are configured)\ntry:\n    response = client.list_streams(MaxResults=1)\n    print(\"Successfully listed Keyspaces Streams (first entry if any):\")\n    if response.get(\"streams\"):\n        print(response[\"streams\"][0])\n    else:\n        print(\"No streams found.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This example demonstrates how to use `mypy-boto3-keyspacesstreams` for type-hinting a `boto3` KeyspacesStreams client. MyPy can then verify the types of client methods and responses."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"As of `mypy-boto3-builder` version 8.12.0 (which generated `mypy-boto3-keyspacesstreams 1.42.59`), support for Python 3.8 has been removed. Users must use Python 3.9 or higher.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0, mypy-boto3-keyspacesstreams >=1.42.59"},{"fix":"Update `TypeDef` references in your code to match the new, often shorter, names as indicated by your type checker.","message":"Starting with `mypy-boto3-builder` version 8.9.0, some `TypeDef` naming conventions changed (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). This might break existing type annotations in your codebase if you've explicitly referenced such types.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0"},{"fix":"Ensure `boto3` is installed in your environment (e.g., `pip install boto3`).","message":"This package provides only type stubs. The actual `boto3` library must be installed separately for any runtime functionality. These stubs enhance development-time type checking but do not add runtime code.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Regularly update both `boto3` and `mypy-boto3-keyspacesstreams` to their latest compatible versions.","message":"Type stubs are generated based on specific `boto3` versions. For the most accurate type checking, it is recommended to keep `mypy-boto3-keyspacesstreams` and `boto3` versions closely synchronized. Major `boto3` updates may introduce new features or changes not reflected in older stubs.","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"}