{"id":3608,"library":"mypy-boto3-kinesis-video-media","title":"mypy-boto3-kinesis-video-media Type Stubs","description":"mypy-boto3-kinesis-video-media provides type annotations for the `boto3` Kinesis Video Media service, enabling static type checking with tools like Mypy. It is part of the `mypy-boto3` project which generates comprehensive type stubs for all AWS services supported by `boto3`. The current version is 1.42.3, and new versions are released frequently, synchronized with `boto3`/`botocore` updates.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["AWS","Boto3","Type Hinting","Mypy","Stubs","Kinesis Video Media"],"install":[{"cmd":"pip install mypy-boto3-kinesis-video-media","lang":"bash","label":"Install service stubs"},{"cmd":"pip install boto3","lang":"bash","label":"Install runtime dependency (if not already)"}],"dependencies":[],"imports":[{"note":"Import for explicit type annotation of the boto3 client.","symbol":"KinesisVideoMediaClient","correct":"from mypy_boto3_kinesis_video_media.client import KinesisVideoMediaClient"},{"note":"The primary runtime library, whose client methods are typed by this package.","symbol":"boto3","correct":"import boto3"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\n# These type imports are only needed for explicit annotations during type checking.\n# Mypy often discovers them automatically if the stubs are installed.\nif TYPE_CHECKING:\n    from mypy_boto3_kinesis_video_media.client import KinesisVideoMediaClient\n    from mypy_boto3_kinesis_video_media.type_defs import GetMediaInputRequestTypeDef\n\n\ndef get_kinesis_video_media_client():\n    # In a real application, ensure credentials/region are configured\n    # via environment variables, ~/.aws/credentials, or boto3 session config.\n    # For this example, we assume default configuration.\n    client = boto3.client(\"kinesis-video-media\")\n    \n    # For static type checking with Mypy, you can explicitly annotate the client.\n    if TYPE_CHECKING:\n        typed_client: KinesisVideoMediaClient = client\n        # Example of using a TypedDict from the stubs\n        get_media_params: GetMediaInputRequestTypeDef = {\n            \"StreamARN\": \"arn:aws:kinesisvideo:REGION:ACCOUNT_ID:stream/YOUR_STREAM/1234567890123\",\n            \"StartSelector\": {\"StartSelectorType\": \"NOW\"}\n        }\n        print(f\"Client with type hints ready: {typed_client}\")\n        # Mypy will now validate calls to `typed_client` based on KinesisVideoMedia API.\n        # Example (commented out as it requires a live stream and specific permissions):\n        # response = typed_client.get_media(**get_media_params)\n        # print(f\"Response: {response}\")\n    else:\n        print(f\"Runtime client: {client}\")\n\nget_kinesis_video_media_client()","lang":"python","description":"This quickstart demonstrates how to obtain a `boto3` Kinesis Video Media client and explicitly type it using the `mypy-boto3-kinesis-video-media` stubs. This allows static analysis tools like Mypy to provide autocompletion and validate method calls against the AWS API specification. Note that actual API calls require a properly configured AWS environment and valid stream ARNs."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0. Any `mypy-boto3-*` packages built with 8.12.0 or newer (including `mypy-boto3-kinesis-video-media` 1.42.3) require Python 3.9 or higher.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0 (and dependent service packages)"},{"fix":"Update your code to use the new TypeDef naming conventions. Consult the specific service's `mypy-boto3` documentation for exact changes.","message":"Starting with `mypy-boto3-builder` 8.9.0, TypeDef names for method arguments (especially those ending with 'RequestTypeDef') were shortened, and conflicting TypeDef 'Extra' postfixes were moved. This can break code that directly imports or references specific TypeDefs.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0 (and dependent service packages like `mypy-boto3-kinesis-video-media` 1.42.3)"},{"fix":"Install `mypy-boto3-core` for general boto3 typing or install specific `mypy-boto3-SERVICE_NAME` packages for each service your application uses.","message":"These are service-specific stubs. To type-check all `boto3` clients, you typically need to install `mypy-boto3-core` or install a separate `mypy-boto3-*` package for each AWS service you use. Mypy will only provide type hints for the services whose stubs are installed.","severity":"gotcha","affected_versions":"All versions"},{"fix":"No specific fix required for most users, as this improves standard behavior. If issues arise, ensure your `pip` is up-to-date and your environment correctly handles PEP 561 stub-only packages.","message":"The `mypy-boto3` project migrated to PEP 561 compliant packages in `mypy-boto3-builder` version 8.12.0. While this generally improves compatibility and discovery, ensure your build system properly recognizes and uses namespace packages if you encounter issues.","severity":"gotcha","affected_versions":"mypy-boto3-builder >= 8.12.0 (and dependent service packages)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}