{"id":3675,"library":"mypy-boto3-pipes","title":"mypy-boto3-pipes Type Annotations","description":"mypy-boto3-pipes provides type annotations for the `boto3` EventBridgePipes service, ensuring compatibility with type checkers like Mypy, Pyright, and various IDEs. It is part of the `mypy-boto3` family of projects, generated by `mypy-boto3-builder`, and its version aligns with the corresponding `boto3` version. The library is actively maintained with frequent updates following `boto3` releases.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type-hints","boto3","aws","mypy","stubs","eventbridge-pipes","dev-dependency"],"install":[{"cmd":"pip install mypy-boto3-pipes boto3 mypy","lang":"bash","label":"Install library, runtime, and type checker"}],"dependencies":[{"reason":"Provides the core AWS SDK runtime that these stubs type-check.","package":"boto3"},{"reason":"Required to perform static type checking with these stubs.","package":"mypy","optional":true}],"imports":[{"note":"Use this for explicit type hinting of the boto3 EventBridgePipes client.","symbol":"PipesClient","correct":"from mypy_boto3_pipes.client import PipesClient"},{"note":"Provides a literal type for the service name 'pipes' for stricter type checking.","symbol":"EventBridgePipesServiceName","correct":"from mypy_boto3_pipes.literals import EventBridgePipesServiceName"},{"note":"Provides type definitions for service-specific structures (e.g., input/output dictionaries).","symbol":"PipeStateTypeDef","correct":"from mypy_boto3_pipes.type_defs import PipeStateTypeDef"}],"quickstart":{"code":"import boto3\nimport os\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from mypy_boto3_pipes.client import PipesClient\n    from mypy_boto3_pipes.type_defs import ListPipesResponseTypeDef\n\n# Ensure boto3 is configured, e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION\n# For this example, we'll just create a client.\n# In a real application, ensure credentials are set up (e.g., via environment variables or ~/.aws/credentials)\n\ndef get_pipes_client() -> 'PipesClient':\n    # The explicit type annotation here (PipesClient) enables type checking and autocompletion\n    client: PipesClient = boto3.client(\n        \"pipes\",\n        aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY'),\n        aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET'),\n        region_name=os.environ.get('AWS_REGION', 'us-east-1')\n    )\n    return client\n\ndef list_eventbridge_pipes():\n    pipes_client = get_pipes_client()\n    try:\n        response: ListPipesResponseTypeDef = pipes_client.list_pipes(\n            MaxResults=5\n        )\n        print(\"Successfully listed pipes:\")\n        for pipe in response.get('Pipes', []):\n            print(f\"  Pipe Name: {pipe.get('Name')}, State: {pipe.get('State')}\")\n    except Exception as e:\n        print(f\"Error listing pipes: {e}\")\n\nif __name__ == \"__main__\":\n    list_eventbridge_pipes()","lang":"python","description":"This quickstart demonstrates how to initialize a `boto3` client for EventBridge Pipes with type hints from `mypy-boto3-pipes` and perform a simple `list_pipes` operation. The `TYPE_CHECKING` block ensures that `mypy-boto3-pipes` is only a development dependency."},"warnings":[{"fix":"Upgrade Python to 3.9 or newer.","message":"Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0, which generates these stubs. Ensure your environment uses Python 3.9 or higher.","severity":"breaking","affected_versions":">=8.12.0 of mypy-boto3-builder (impacts mypy-boto3-pipes versions generated by it)"},{"fix":"Review your explicit `from mypy_boto3_pipes.type_defs import ...` statements and adjust to the new, shorter names if applicable.","message":"TypeDef names were shortened in `mypy-boto3-builder` 8.9.0 (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). If you manually import TypeDefs, their names might have changed.","severity":"breaking","affected_versions":">=8.9.0 of mypy-boto3-builder"},{"fix":"Ensure `pip install boto3` is part of your project's dependencies.","message":"This library provides only type stubs. You must install `boto3` (the actual AWS SDK) separately for your code to run. `mypy-boto3-pipes` provides no runtime functionality.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Periodically update `mypy-boto3-pipes` along with `boto3` to maintain type accuracy. Check the `mypy-boto3` documentation for versioning guidance.","message":"The version of `mypy-boto3-pipes` should ideally match the major and minor version of your installed `boto3` library for full compatibility and accurate type hints.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Use `from typing import TYPE_CHECKING` and conditionally import stubs: `if TYPE_CHECKING: from mypy_boto3_pipes.client import PipesClient`.","message":"For production environments, it is recommended to wrap imports of `mypy-boto3` stubs within `if TYPE_CHECKING:` blocks to prevent them from becoming runtime dependencies.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Install `mypy-boto3-pipes-lite` instead, or disable PyCharm's internal type checker and use Mypy/Pyright.","message":"Users of PyCharm may experience slow performance or high CPU usage due to `Literal` overloads. Consider using `mypy-boto3-pipes-lite` or an external type checker like Mypy/Pyright.","severity":"gotcha","affected_versions":"All versions with PyCharm"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}