Type Annotations for boto3 EventBridgeScheduler

1.42.3 · active · verified Fri Apr 10

mypy-boto3-scheduler provides type annotations for the boto3 EventBridgeScheduler service, currently at version 1.42.3. These stubs are generated by mypy-boto3-builder (version 8.12.0) and are designed to enhance type checking for boto3 code with tools like mypy, pyright, and various IDEs. The mypy-boto3-builder project has a rapid release cadence, frequently updating stubs to match boto3 releases and introducing new features or breaking changes.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import the `EventBridgeSchedulerClient` type and use it to explicitly type-hint your `boto3` client. This enables static type checking and provides rich IDE auto-completion for all client methods and their arguments.

import boto3
from mypy_boto3_scheduler import EventBridgeSchedulerClient

def get_scheduler_client() -> EventBridgeSchedulerClient:
    """Returns a type-hinted EventBridgeScheduler client."""
    # boto3.client('scheduler') without explicit type annotation
    # would return a 'Client' type, losing type-checking benefits.
    client: EventBridgeSchedulerClient = boto3.client("scheduler")
    return client

if __name__ == "__main__":
    # Example usage: List schedules
    scheduler_client = get_scheduler_client()
    try:
        response = scheduler_client.list_schedules(MaxResults=1)
        print("Successfully listed schedules.")
        for schedule in response.get('Schedules', []):
            print(f" - {schedule.get('Name')}")
    except Exception as e:
        print(f"Error listing schedules: {e}")

view raw JSON →