{"id":3630,"library":"mypy-boto3-mediapackage","title":"mypy-boto3-mediapackage: Type Annotations for AWS MediaPackage","description":"mypy-boto3-mediapackage provides type annotations for the boto3 MediaPackage 1.42.3 service. It enables static type checking for AWS MediaPackage clients within Python applications, enhancing code quality and developer experience. The library is generated by `mypy-boto3-builder` and is actively maintained with frequent updates, often aligning with new boto3 releases and builder improvements.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["mypy","boto3","aws","type-hints","stubs","mediapackage","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-mediapackage boto3","lang":"bash","label":"Install with boto3"},{"cmd":"pip install 'boto3-stubs[mediapackage]' mypy","lang":"bash","label":"Alternative via boto3-stubs (recommended for multiple services)"}],"dependencies":[{"reason":"Required for runtime.","package":"python","version":">=3.9"},{"reason":"Runtime dependency for which type stubs are provided. This package provides no runtime functionality itself.","package":"boto3","optional":false},{"reason":"The static type checker for which these stubs are primarily intended.","package":"mypy","optional":true}],"imports":[{"note":"The typed client for the MediaPackage service.","symbol":"MediaPackageClient","correct":"from mypy_boto3_mediapackage.client import MediaPackageClient"},{"note":"Literal type for the service name 'mediapackage', useful for type-safe client creation.","symbol":"MediaPackageServiceName","correct":"from mypy_boto3_mediapackage.literals import MediaPackageServiceName"},{"note":"The standard boto3 session import, used to create clients.","symbol":"Session","correct":"from boto3.session import Session"}],"quickstart":{"code":"import os\nfrom boto3.session import Session\nfrom mypy_boto3_mediapackage.client import MediaPackageClient\n\n# Ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)\n# For example: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME\n# Using os.environ.get for example purposes, in real apps boto3 handles credentials automatically.\nif not os.environ.get('AWS_ACCESS_KEY_ID'):\n    print(\"Warning: AWS_ACCESS_KEY_ID not set. Quickstart might fail if credentials are not configured.\")\n\nsession = Session()\n\n# Explicitly type the client for full type-hinting and autocompletion\nmediapackage_client: MediaPackageClient = session.client(\"mediapackage\")\n\n# Example: List origin endpoints (replace with an actual method if needed)\ntry:\n    response = mediapackage_client.list_origin_endpoints()\n    print(\"Successfully listed MediaPackage origin endpoints.\")\n    for endpoint in response.get('OriginEndpoints', []):\n        print(f\" - Endpoint ID: {endpoint.get('Id')}, ARN: {endpoint.get('Arn')}\")\nexcept Exception as e:\n    print(f\"Error listing origin endpoints: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to initialize a `boto3` MediaPackage client and apply type annotations from `mypy-boto3-mediapackage`. Explicitly typing the client (`mediapackage_client: MediaPackageClient`) is crucial for enabling comprehensive type checking and autocompletion in IDEs."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or a later version.","message":"Python 3.8 support has been officially removed. Users on Python 3.8 or older must upgrade to Python 3.9 or newer to use versions 8.12.0+ of `mypy-boto3-builder` generated stubs.","severity":"breaking","affected_versions":"mypy-boto3-builder 8.12.0+, mypy-boto3-mediapackage 1.42.0+"},{"fix":"Ensure `mypy` is run in the same Python environment where `mypy-boto3-mediapackage` is installed. Review `mypy`'s documentation on PEP 561 for advanced scenarios if issues arise with stub discovery. Using `boto3-stubs` with service extras (`pip install 'boto3-stubs[mediapackage]'`) is generally recommended for seamless integration.","message":"The `mypy-boto3` ecosystem migrated to PEP 561 compliant packages. While generally an improvement, this might affect how `mypy` discovers stubs in certain environments or custom build setups.","severity":"breaking","affected_versions":"mypy-boto3-builder 8.12.0+, mypy-boto3-mediapackage 1.42.0+"},{"fix":"Review and update any explicit references to `TypeDef` objects in your code to match the new naming conventions. Consult the `mypy-boto3` documentation for the specific service for the correct `TypeDef` names.","message":"Breaking changes were introduced to TypeDef naming conventions. Specifically, `CreateDistributionRequestRequestTypeDef` was shortened to `CreateDistributionRequestTypeDef`, and conflicting `Extra` postfixes were moved (e.g., `CreateDistributionExtraRequestTypeDef` became `CreateDistributionRequestExtraTypeDef`).","severity":"breaking","affected_versions":"mypy-boto3-builder 8.9.0+, mypy-boto3-mediapackage versions generated by these builders."},{"fix":"Always add explicit type annotations when creating `boto3` clients or resources, leveraging the `Client` and `ServiceResource` types from the respective `mypy-boto3` service package.","message":"For optimal type checking and IDE autocompletion, it is highly recommended to explicitly type annotate `boto3.client()` and `boto3.resource()` calls with the specific `mypy-boto3` client or resource type (e.g., `client: MediaPackageClient = session.client('mediapackage')`). While `mypy` can often infer types, explicit annotation provides the most robust experience.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Be aware of the new `aws_account_id` parameter if your workflows could benefit from it, and update your client creation calls if necessary to utilize it.","message":"The `Session.client` and global `boto3.client` methods gained an `aws_account_id` argument. This new feature allows specifying the AWS account ID when creating a client, which can be useful for certain cross-account operations or internal tooling.","severity":"gotcha","affected_versions":"mypy-boto3-builder 8.10.1+, mypy-boto3-mediapackage versions generated by these builders."}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}