{"id":3633,"library":"mypy-boto3-mediastore","title":"mypy-boto3-mediastore","description":"mypy-boto3-mediastore provides type annotations for the boto3 AWS MediaStore service. It is part of the `mypy-boto3` family of stub packages, generated by `mypy-boto3-builder`, and is frequently updated to align with `boto3` releases and AWS API changes. This allows for static type checking of boto3 client calls, enhancing code quality and developer experience.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type-hints","mypy","boto3","aws","cloud","mediastore","stubs","type-checking"],"install":[{"cmd":"pip install mypy-boto3-mediastore boto3 mypy","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"This package provides type stubs for boto3; boto3 itself must be installed and used at runtime.","package":"boto3","optional":false},{"reason":"Required for static type checking using these stubs.","package":"mypy","optional":true}],"imports":[{"symbol":"MediaStoreClient","correct":"from mypy_boto3_mediastore import MediaStoreClient"},{"symbol":"ContainerTypeDef","correct":"from mypy_boto3_mediastore.type_defs import ContainerTypeDef"},{"symbol":"ListContainersPaginator","correct":"from mypy_boto3_mediastore.paginator import ListContainersPaginator"},{"symbol":"ContainerLevelMetricsType","correct":"from mypy_boto3_mediastore.literals import ContainerLevelMetricsType"}],"quickstart":{"code":"import os\nimport boto3\nfrom mypy_boto3_mediastore import MediaStoreClient\nfrom mypy_boto3_mediastore.type_defs import ContainerTypeDef\n\ndef list_mediastore_containers(client: MediaStoreClient) -> list[ContainerTypeDef]:\n    \"\"\"Lists MediaStore containers and returns typed responses.\"\"\"\n    response = client.list_containers()\n    containers = response.get('Containers', [])\n    print(f\"Found {len(containers)} MediaStore containers.\")\n    for container in containers:\n        print(f\"  Container Name: {container.get('Name')}, Status: {container.get('Status')}\")\n    return containers\n\nif __name__ == \"__main__\":\n    # Ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)\n    session = boto3.Session(region_name=os.environ.get('AWS_REGION', 'us-east-1'))\n    mediastore_client: MediaStoreClient = session.client('mediastore')\n    \n    print(\"Listing MediaStore containers...\")\n    containers = list_mediastore_containers(mediastore_client)\n    \n    # Example of accessing a typed attribute (mypy would check this)\n    if containers:\n        first_container_arn: str = containers[0]['ARN']\n        print(f\"First container ARN: {first_container_arn}\")\n\n    # To run static analysis:\n    # pip install mypy\n    # mypy your_script_name.py\n","lang":"python","description":"This quickstart demonstrates how to use `mypy-boto3-mediastore` for type-hinting a boto3 MediaStore client. It shows explicit type annotation for the client and the return type of a method call. To verify type checking, ensure `mypy` is installed and run `mypy` on the script."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer. Consider using `pyenv` or similar tools for managing Python versions.","message":"Support for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0 and later, affecting packages built with it, including `mypy-boto3-mediastore`. Ensure your project uses Python 3.9 or higher.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0, mypy-boto3-mediastore >=1.42.0"},{"fix":"Review and update any direct `import` statements for `TypeDef` classes to match the new, often shorter, naming conventions.","message":"TypeDef naming conventions were changed in `mypy-boto3-builder` version 8.9.0. This might affect direct imports of specific `TypeDef` classes (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`).","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0, mypy-boto3-mediastore versions built with it"},{"fix":"Always include `boto3` in your project's dependencies alongside `mypy-boto3-mediastore` (e.g., `pip install boto3 mypy-boto3-mediastore`).","message":"This package provides *only* type stubs. You must install the actual `boto3` library to use AWS services at runtime. `mypy-boto3-mediastore` will be automatically detected by `mypy` (PEP 561 compliant) if both are installed in the same environment.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Add explicit type annotations when initializing boto3 clients or resources, such as `client: MediaStoreClient = session.client('mediastore')`.","message":"While `mypy` often automatically infers types, explicit type annotations for `boto3.client` and similar calls (e.g., `client: MediaStoreClient = session.client('mediastore')`) are highly recommended for better IDE auto-completion and more robust type checking, especially with versions like `boto3-stubs-lite` which do not provide `session.client/resource` overloads.","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"}