mypy-boto3-appflow
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
- breaking Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0 (which generates `mypy-boto3-appflow` versions 1.42.x onwards). Packages now require Python 3.9 or newer.
- breaking TypeDef naming conventions changed in `mypy-boto3-builder` version 8.9.0. This might affect code that explicitly imports or references TypeDefs with previously conflicting or redundant naming patterns (e.g., `CreateDistributionRequestRequestTypeDef` becoming `CreateDistributionRequestTypeDef`).
- gotcha This package (`mypy-boto3-appflow`) provides *only* type stubs for the Appflow service. It does not include the actual runtime `boto3` library. You must install `boto3` separately for your code to function.
Install
-
pip install mypy-boto3-appflow boto3
Imports
- AppflowClient
from mypy_boto3_appflow.client import AppflowClient
- ListFlowsResponseTypeDef
from mypy_boto3_appflow.type_defs import ListFlowsResponseTypeDef
Quickstart
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}")