由mypyboto3buider 4.2.0生成的boto3.sfn1.16.35服务的类型注释

mypy-boto3-stepfunctions的Python项目详细描述


mypy-boto3-阶跃函数

PyPI - mypy-boto3-stepfunctionsPyPI - Python VersionDocs

boto3.typed

的类型批注 boto3.SFN 1.16.35服务 兼容 VSCodePyCharmEmacsSublime Textmypypyright 以及其他工具。在

mypy-boto3-buider 4.2.0生成。在

更多信息可在boto3-stubs页找到。在

了解它如何帮助查找和修复潜在的错误:

boto3-stubs demo

如何安装

SFN服务安装boto3-stubs。在

python -m pip install boto3-stubs[stepfunctions]

使用

VSCode

  • 安装Python extension
  • 安装Pylance extension
  • Pylance设置为Python语言服务器
  • 在您的环境中安装boto-stubs[stepfunctions]python -m pip install 'boto3-stubs[stepfunctions]'

类型检查和自动完成都应该适用于SFN服务。 不需要显式的类型注释,请照常编写boto3代码。在

PyCharm

  • 在您的环境中安装boto-stubs[stepfunctions]python -m pip install 'boto3-stubs[stepfunctions]'

类型检查和自动完成都应该适用于SFN服务。 不需要显式的类型注释,请照常编写boto3代码。 自动完成在大型项目或安装了大量boto3-stubs子模块时可能会很慢。在

其他IDE

没有经过测试,但是只要您的IDE支持mypy或{},一切都应该正常。在

mypy

  • 安装mypypython -m pip install mypy
  • 在您的环境中安装boto-stubs[stepfunctions]python -m pip install 'boto3-stubs[stepfunctions]'
  • 像往常一样运行mypy

类型检查应该适用于SFN服务。 不需要显式的类型注释,请照常编写boto3代码。在

pyright

  • 安装pyrightyarn global add pyright
  • 在您的环境中安装boto-stubs[stepfunctions]python -m pip install 'boto3-stubs[stepfunctions]'
  • 或者,您可以将boto3-stubs安装到typings文件夹中。在

类型检查应该适用于SFN服务。 不需要显式的类型注释,请照常编写boto3代码。在

显式类型批注

客户端注释

SFNClientboto3.client("stepfunctions")提供注释。在

^{pr2}$

分页器注释

mypy_boto3_stepfunctions.paginator模块包含所有分页器的类型注释。在

frommypy_boto3_stepfunctionsimportSFNClientfrommypy_boto3_stepfunctions.paginatorimport(GetExecutionHistoryPaginator,ListActivitiesPaginator,ListExecutionsPaginator,ListStateMachinesPaginator,)client:SFNClient=boto3.client("stepfunctions")# Explicit type annotations are optional here# Type should be correctly discovered by mypy and IDEs# VSCode requires explicit type annotationsget_execution_history_paginator:GetExecutionHistoryPaginator=client.get_paginator("get_execution_history")list_activities_paginator:ListActivitiesPaginator=client.get_paginator("list_activities")list_executions_paginator:ListExecutionsPaginator=client.get_paginator("list_executions")list_state_machines_paginator:ListStateMachinesPaginator=client.get_paginator("list_state_machines")

键入的措辞

mypy_boto3_stepfunctions.type_defs模块包含组合的结构和形状 以进行额外的类型检查。在

frommypy_boto3_stepfunctions.type_defsimport(ActivityFailedEventDetailsTypeDef,ActivityListItemTypeDef,ActivityScheduledEventDetailsTypeDef,ActivityScheduleFailedEventDetailsTypeDef,ActivityStartedEventDetailsTypeDef,ActivitySucceededEventDetailsTypeDef,ActivityTimedOutEventDetailsTypeDef,BillingDetailsTypeDef,CloudWatchEventsExecutionDataDetailsTypeDef,CloudWatchLogsLogGroupTypeDef,CreateActivityOutputTypeDef,CreateStateMachineOutputTypeDef,DescribeActivityOutputTypeDef,DescribeExecutionOutputTypeDef,DescribeStateMachineForExecutionOutputTypeDef,DescribeStateMachineOutputTypeDef,ExecutionAbortedEventDetailsTypeDef,ExecutionFailedEventDetailsTypeDef,ExecutionListItemTypeDef,ExecutionStartedEventDetailsTypeDef,ExecutionSucceededEventDetailsTypeDef,ExecutionTimedOutEventDetailsTypeDef,GetActivityTaskOutputTypeDef,GetExecutionHistoryOutputTypeDef,HistoryEventExecutionDataDetailsTypeDef,HistoryEventTypeDef,LambdaFunctionFailedEventDetailsTypeDef,LambdaFunctionScheduledEventDetailsTypeDef,LambdaFunctionScheduleFailedEventDetailsTypeDef,LambdaFunctionStartFailedEventDetailsTypeDef,LambdaFunctionSucceededEventDetailsTypeDef,LambdaFunctionTimedOutEventDetailsTypeDef,ListActivitiesOutputTypeDef,ListExecutionsOutputTypeDef,ListStateMachinesOutputTypeDef,ListTagsForResourceOutputTypeDef,LogDestinationTypeDef,LoggingConfigurationTypeDef,MapIterationEventDetailsTypeDef,MapStateStartedEventDetailsTypeDef,PaginatorConfigTypeDef,ResponseMetadata,StartExecutionOutputTypeDef,StartSyncExecutionOutputTypeDef,StateEnteredEventDetailsTypeDef,StateExitedEventDetailsTypeDef,StateMachineListItemTypeDef,StopExecutionOutputTypeDef,TagTypeDef,TaskFailedEventDetailsTypeDef,TaskScheduledEventDetailsTypeDef,TaskStartedEventDetailsTypeDef,TaskStartFailedEventDetailsTypeDef,TaskSubmitFailedEventDetailsTypeDef,TaskSubmittedEventDetailsTypeDef,TaskSucceededEventDetailsTypeDef,TaskTimedOutEventDetailsTypeDef,TracingConfigurationTypeDef,UpdateStateMachineOutputTypeDef,)defget_structure()->ActivityFailedEventDetailsTypeDef:return{...}

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java为什么会出现这些错误?表达式的非法开始   使用HttpUrlConnection的java测试URL仅适用于前面的www   在大数据集上使用kmeans的java堆外内存   查找Java RandomAccessFile如何以字符形式读取第n个字节   java Android从BroadcastReceiver获取标题和描述   java使用构造函数参数模拟嵌套类并测试方法   正在将Azure Blob项强制转换为Java文件对象   java并行运行testNG套件   java程序在运行时似乎没有进入   贬低Java规则引擎的优点和缺点   文本区域中的java中心文本   java JPA从多个表中选择错误   类Java问题使用类加载器重新加载代码   java如何在Spring非管理类上使用@Value   java(关闭)Gradle导入VS代码失败   java arraylist拆分(“空白”)并计算字数   Android/Java如何在单独的*中调用函数。java文件?   具有基本身份验证的java Apache Camel RSS模块   java为什么程序在出现溢出或下溢时不抛出异常