Type annotations for boto3.SWF 1.14.28 service, generated by mypy-boto3-buider 2.2.0
Project description
mypy-boto3-swf
Type annotations for boto3.SWF 1.14.28 service compatible with mypy, VSCode, PyCharm and other tools.
Generated by mypy-boto3-buider 2.2.0.
More information can be found on boto3-stubs page.
How to install
Make sure you have mypy installed and activated in your IDE.
Install boto3-stubs
for SWF
service.
python -m pip install boto3-stubs[swf]
How to use
Client annotations
SWFClient
provides annotations for boto3.client("swf")
.
import boto3
from mypy_boto3_swf import SWFClient
from mypy_boto3_swf.paginator import (
GetWorkflowExecutionHistoryPaginator,
ListActivityTypesPaginator,
ListClosedWorkflowExecutionsPaginator,
ListDomainsPaginator,
ListOpenWorkflowExecutionsPaginator,
ListWorkflowTypesPaginator,
PollForDecisionTaskPaginator,
)
from mypy_boto3_swf.type_defs import ActivityTaskCancelRequestedEventAttributesTypeDef, ...
client: SWFClient = boto3.client("swf")
# now client usage is checked by mypy and IDE should provide code auto-complete
# works for session as well
session = boto3.session.Session(region="us-west-1")
session_client: SWFClient = session.client("swf")
Paginators annotations
mypy_boto3_swf.paginator
module contains type annotations for all paginators.
client: SWFClient = boto3.client("swf")
# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
# VSCode requires explicit type annotations
get_workflow_execution_history_paginator: GetWorkflowExecutionHistoryPaginator = client.get_paginator("get_workflow_execution_history")
list_activity_types_paginator: ListActivityTypesPaginator = client.get_paginator("list_activity_types")
list_closed_workflow_executions_paginator: ListClosedWorkflowExecutionsPaginator = client.get_paginator("list_closed_workflow_executions")
list_domains_paginator: ListDomainsPaginator = client.get_paginator("list_domains")
list_open_workflow_executions_paginator: ListOpenWorkflowExecutionsPaginator = client.get_paginator("list_open_workflow_executions")
list_workflow_types_paginator: ListWorkflowTypesPaginator = client.get_paginator("list_workflow_types")
poll_for_decision_task_paginator: PollForDecisionTaskPaginator = client.get_paginator("poll_for_decision_task")
Typed dictionations
mypy_boto3_swf.type_defs
module contains structures and shapes assembled
to typed dictionaries for additional type checking.
def get_structure() -> ActivityTaskCancelRequestedEventAttributesTypeDef:
return {
...
}
Dynamic type annotations
mypy_boto3
command generates boto3.client/resource
type annotations for
mypy_boto3_swf
and other installed services.
# Run this command after you add or remove service packages
python -m mypy_boto3
Generated type annotations provide overloads for boto3.client
and boto3.resource
,
boto3.Session.client
and boto3.Session.resource
functions,
so explicit type annotations are not needed.
mypy
supports function overloads as expectedPyCharm
also supports function overloads, but consumes a lot of RAM, use carefully if you have many services installedVSCode
does not currently support function overloads, use explicit type annotations
# Type is discovered correctly by mypy and PyCharm
# VSCode still needs explicit type annotations
client = boto3.client("swf")
session_client = boto3.Session().client("swf")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mypy_boto3_swf-1.14.28.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a4a798515ca2f39e78188d44087ffaf3f844aa3ce06ab05d182e15af5d7fbcd |
|
MD5 | f3703d8bc519b6871251b721cd00ef3f |
|
BLAKE2b-256 | 0b33b63ca3de5fae6b718a63656405d2f38404f9f145eb07b4b890d90a7f63d5 |