{"id":3632,"library":"mypy-boto3-mediastore-data","title":"mypy-boto3-mediastore-data","description":"Type annotations for the boto3 MediaStoreData service (version 1.42.3), generated with mypy-boto3-builder 8.12.0. This library provides type hints compatible with static analysis tools like mypy and IDEs such as VSCode and PyCharm, enhancing code completion and catching type-related errors early. It is actively maintained with releases frequently updated to match boto3 versions.","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","type-hints","mediastore","data","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-mediastore-data","lang":"bash","label":"Standalone package"},{"cmd":"pip install 'boto3-stubs[mediastore-data]'","lang":"bash","label":"As part of the full boto3-stubs package"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK","package":"boto3","optional":false}],"imports":[{"symbol":"MediaStoreDataClient","correct":"from mypy_boto3_mediastore_data.client import MediaStoreDataClient"},{"symbol":"PutObjectRequestTypeDef","correct":"from mypy_boto3_mediastore_data.type_defs import PutObjectRequestTypeDef"},{"symbol":"PutObjectResponseTypeDef","correct":"from mypy_boto3_mediastore_data.type_defs import PutObjectResponseTypeDef"},{"symbol":"StorageClassType","correct":"from mypy_boto3_mediastore_data.literals import StorageClassType"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_mediastore_data.client import MediaStoreDataClient\nfrom mypy_boto3_mediastore_data.type_defs import PutObjectResponseTypeDef\n\ndef upload_to_mediastore_data(container_endpoint: str, object_path: str, data: bytes, content_type: str) -> PutObjectResponseTypeDef:\n    \"\"\"Uploads an object to AWS Elemental MediaStore Data plane.\"\"\"\n    # Create a boto3 session. Credentials will be picked up from environment variables or ~/.aws/credentials\n    session = boto3.Session()\n\n    # Create a MediaStoreData client using the container endpoint\n    client: MediaStoreDataClient = session.client(\n        \"mediastore-data\", \n        endpoint_url=container_endpoint,\n        region_name=os.environ.get('AWS_REGION', 'us-east-1') # Or specify your region\n    )\n\n    print(f\"Uploading object to {object_path} in container at {container_endpoint}...\")\n    response: PutObjectResponseTypeDef = client.put_object(\n        Body=data,\n        Path=object_path,\n        ContentType=content_type,\n        # StorageClass='TEMPORAL' # Optional, default is TEMPORAL\n        # UploadAvailability='STANDARD' # Optional, default is STANDARD\n    )\n    print(f\"Upload successful. ETag: {response.get('ETag')}, ContentSHA256: {response.get('ContentSHA256')}\")\n    return response\n\n# Example usage (replace with your actual endpoint and data)\nif __name__ == \"__main__\":\n    import os\n    sample_endpoint = os.environ.get('MEDIASTORE_DATA_ENDPOINT', 'https://data.mediastore.us-east-1.amazonaws.com')\n    sample_path = \"videos/my_video.mp4\"\n    sample_data = b\"This is some sample video content.\"\n    sample_content_type = \"video/mp4\"\n\n    if not sample_endpoint or sample_endpoint == 'https://data.mediastore.us-east-1.amazonaws.com':\n        print(\"WARNING: Please set the MEDIASTORE_DATA_ENDPOINT environment variable to your container's data endpoint.\")\n        print(\"Skipping actual upload, showing example structure only.\")\n    else:\n        try:\n            upload_to_mediastore_data(sample_endpoint, sample_path, sample_data, sample_content_type)\n        except Exception as e:\n            print(f\"Error during upload: {e}\")\n","lang":"python","description":"This example demonstrates how to initialize a `MediaStoreDataClient` with explicit type hinting and use the `put_object` method to upload data to an AWS Elemental MediaStore container. It showcases using `PutObjectResponseTypeDef` for the return type and includes error handling. Remember to replace placeholder values and ensure `boto3` is configured with appropriate AWS credentials and the MediaStore container's data endpoint."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Support for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0 and later. Users must use Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Ensure your `mypy` configuration (or other type checkers) is up-to-date and correctly discovers PEP 561 packages. Generally, this change should be transparent for most users.","message":"The `mypy-boto3` packages (including this one) migrated to PEP 561 compliant packaging in `mypy-boto3-builder` 8.12.0. This might change how some older or custom type-checking setups discover stubs.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Update any custom type hints or code that directly references these generated TypeDef names to reflect the shorter convention.","message":"TypeDef naming conventions changed in `mypy-boto3-builder` 8.9.0. Previously, some TypeDefs for packed method arguments had redundant `RequestRequestTypeDef` suffixes (e.g., `CreateDistributionRequestRequestTypeDef`). These are now shortened (e.g., `CreateDistributionRequestTypeDef`).","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0"},{"fix":"Explicitly type your client, e.g., `client: MediaStoreDataClient = session.client('mediastore-data')`.","message":"For optimal code completion and type checking in IDEs like VSCode and PyCharm, it is recommended to use explicit type annotations for `boto3.client()` and `boto3.session.client()` calls.","severity":"gotcha","affected_versions":"All"},{"fix":"Uninstall existing stubs (`pip uninstall boto3-stubs`) and install the lite version: `pip install 'boto3-stubs-lite[mediastore-data]'`. Alternatively, disable PyCharm's internal type checker and use `mypy` or `pyright` externally.","message":"PyCharm users experiencing slow performance or high CPU usage due to Literal overloads (PyCharm issue PY-40997) might benefit from installing `boto3-stubs-lite` instead of the full `boto3-stubs` or `mypy-boto3-*` packages. The lite version is more RAM-friendly but requires more explicit type annotations.","severity":"gotcha","affected_versions":"All (specific to PyCharm)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}