mypy-boto3-appflow

1.42.3 · active · verified Thu Apr 09

mypy-boto3-appflow provides type annotations for the boto3 Appflow service, enhancing static analysis for Python applications using mypy. It's generated by the `mypy-boto3-builder` project, currently at version 1.42.3, and follows a rapid release cycle to keep pace with boto3 updates.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use `mypy-boto3-appflow` to add type hints to a `boto3` Appflow client. It initializes an Appflow client, calls `list_flows` with type-annotated variables, and prints flow details. Ensure `boto3` is also installed and AWS credentials are configured.

import boto3
from mypy_boto3_appflow.client import AppflowClient
from mypy_boto3_appflow.type_defs import ListFlowsResponseTypeDef

def get_appflow_flows() -> ListFlowsResponseTypeDef:
    # mypy-boto3-appflow provides type hints for the boto3 client
    client: AppflowClient = boto3.client('appflow')
    response: ListFlowsResponseTypeDef = client.list_flows()
    for flow in response.get('flows', []):
        print(f"Flow Name: {flow.get('flowName')}, ARN: {flow.get('flowArn')}")
    return response

if __name__ == '__main__':
    # This example requires AWS credentials configured (e.g., via ~/.aws/credentials
    # or environment variables like AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY).
    # It will attempt to list Appflow flows in the configured region.
    try:
        print("Listing Appflow flows...")
        get_appflow_flows()
        print("Finished listing Appflow flows.")
    except Exception as e:
        print(f"An error occurred: {e}")

view raw JSON →