由mypyboto3buider4.2.0生成的boto3.Kinesis 1.16.35服务的类型注释

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


mypy-boto3-运动

PyPI - mypy-boto3-kinesisPyPI - Python VersionDocs

boto3.typed

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

mypy-boto3-buider 4.2.0生成。在

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

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

boto3-stubs demo

如何安装

Kinesis服务安装boto3-stubs。在

python -m pip install boto3-stubs[kinesis]

使用

VSCode

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

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

PyCharm

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

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

其他IDE

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

mypy

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

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

pyright

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

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

显式类型批注

客户端注释

KinesisClientboto3.client("kinesis")提供注释。在

^{pr2}$

分页器注释

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

frommypy_boto3_kinesisimportKinesisClientfrommypy_boto3_kinesis.paginatorimport(DescribeStreamPaginator,ListShardsPaginator,ListStreamConsumersPaginator,ListStreamsPaginator,)client:KinesisClient=boto3.client("kinesis")# Explicit type annotations are optional here# Type should be correctly discovered by mypy and IDEs# VSCode requires explicit type annotationsdescribe_stream_paginator:DescribeStreamPaginator=client.get_paginator("describe_stream")list_shards_paginator:ListShardsPaginator=client.get_paginator("list_shards")list_stream_consumers_paginator:ListStreamConsumersPaginator=client.get_paginator("list_stream_consumers")list_streams_paginator:ListStreamsPaginator=client.get_paginator("list_streams")

服务员注释

mypy_boto3_kinesis.waiter模块包含所有等待者的类型注释。在

frommypy_boto3_kinesisimportKinesisClientfrommypy_boto3_kinesis.waiterimportStreamExistsWaiter,StreamNotExistsWaiterclient:KinesisClient=boto3.client("kinesis")# Explicit type annotations are optional here# Type should be correctly discovered by mypy and IDEs# VSCode requires explicit type annotationsstream_exists_waiter:StreamExistsWaiter=client.get_waiter("stream_exists")stream_not_exists_waiter:StreamNotExistsWaiter=client.get_waiter("stream_not_exists")

键入的措辞

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

frommypy_boto3_kinesis.type_defsimport(ChildShardTypeDef,ConsumerDescriptionTypeDef,ConsumerTypeDef,DescribeLimitsOutputTypeDef,DescribeStreamConsumerOutputTypeDef,DescribeStreamOutputTypeDef,DescribeStreamSummaryOutputTypeDef,EnhancedMetricsTypeDef,EnhancedMonitoringOutputTypeDef,GetRecordsOutputTypeDef,GetShardIteratorOutputTypeDef,HashKeyRangeTypeDef,InternalFailureExceptionTypeDef,KMSAccessDeniedExceptionTypeDef,KMSDisabledExceptionTypeDef,KMSInvalidStateExceptionTypeDef,KMSNotFoundExceptionTypeDef,KMSOptInRequiredTypeDef,KMSThrottlingExceptionTypeDef,ListShardsOutputTypeDef,ListStreamConsumersOutputTypeDef,ListStreamsOutputTypeDef,ListTagsForStreamOutputTypeDef,PaginatorConfigTypeDef,PutRecordOutputTypeDef,PutRecordsOutputTypeDef,PutRecordsRequestEntryTypeDef,PutRecordsResultEntryTypeDef,RecordTypeDef,RegisterStreamConsumerOutputTypeDef,ResourceInUseExceptionTypeDef,ResourceNotFoundExceptionTypeDef,ResponseMetadata,SequenceNumberRangeTypeDef,ShardFilterTypeDef,ShardTypeDef,StartingPositionTypeDef,StreamDescriptionSummaryTypeDef,StreamDescriptionTypeDef,SubscribeToShardEventStreamTypeDef,SubscribeToShardEventTypeDef,SubscribeToShardOutputTypeDef,TagTypeDef,UpdateShardCountOutputTypeDef,WaiterConfigTypeDef,)defget_structure()->ChildShardTypeDef:return{...}

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

推荐PyPI第三方库


热门话题
java后台通知:安卓   java Resultset未返回具有特殊字符/,   等待加载主帧时的java JxBrowser TimeoutException(invokeAndWaitFinishLoadingMainFrame)   java EclipseLink级联持久化异常   JavaMail 1.5.0漏洞还是gmail奇怪的问题?   java循环和IFT语句的装箱   java API不起作用,progressBar一直在旋转   java httpget在“执行”之后不工作   用户界面Java basic GUI程序错误   捕获异常后java代码失败   noclassdeffounderror在一个简单的网络程序中。我正在使用EclipseIDE运行java程序   安卓:java。朗,反思一下。InvocationTargetException有什么建议吗?   java Spring引导未创建数据源   ID为的java RichFaces 4.5 commandLink执行表单   java Struts2:JSP页面无法从数据库获取值   java缓存修改通知?   在java/spring中审计方法变量的最佳方法是什么?