mypy-boto3-emr-serverless Type Stubs

1.42.23 · active · verified Sat Apr 11

mypy-boto3-emr-serverless provides type annotations (stubs) for the boto3 EMRServerless client, enabling static type checking with tools like MyPy. It ensures type safety and autocompletion for EMR Serverless operations when using boto3. The package is generated by `mypy-boto3-builder` and is updated frequently, often in sync with boto3/botocore releases.

Warnings

Install

Imports

Quickstart

This example demonstrates how to use `mypy-boto3-emr-serverless` for type-hinting a boto3 EMR Serverless client. The type import is guarded by `TYPE_CHECKING` to ensure it's only active during static analysis and does not affect runtime, as `mypy-boto3` packages are purely for type stubs.

import boto3
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from mypy_boto3_emr_serverless.client import EMRServerlessClient
    from mypy_boto3_emr_serverless.type_defs import ListApplicationsOutputTypeDef


def get_emr_serverless_applications() -> None:
    client: EMRServerlessClient = boto3.client("emr-serverless")
    response: ListApplicationsOutputTypeDef = client.list_applications()

    print(f"Found {len(response['applications'])} EMR Serverless applications.")
    for app in response.get('applications', []):
        print(f"- {app['name']} (State: {app['state']})")

if __name__ == "__main__":
    get_emr_serverless_applications()

view raw JSON →