由mypyboto3buider 4.2.0生成的boto3.KMS 1.16.35服务的类型注释

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


mypy-boto3-kms公司

PyPI - mypy-boto3-kmsPyPI - Python VersionDocs

boto3.typed

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

mypy-boto3-buider 4.2.0生成。在

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

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

boto3-stubs demo

如何安装

KMS服务安装boto3-stubs。在

python -m pip install boto3-stubs[kms]

使用

VSCode

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

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

PyCharm

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

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

其他IDE

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

mypy

  • 安装mypypython -m pip install mypy
  • 在您的环境中安装boto-stubs[kms]python -m pip install 'boto3-stubs[kms]'
  • {cd13>像往常一样

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

pyright

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

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

显式类型批注

客户端注释

KMSClientboto3.client("kms")提供注释。在

^{pr2}$

分页器注释

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

frommypy_boto3_kmsimportKMSClientfrommypy_boto3_kms.paginatorimport(ListAliasesPaginator,ListGrantsPaginator,ListKeyPoliciesPaginator,ListKeysPaginator,)client:KMSClient=boto3.client("kms")# Explicit type annotations are optional here# Type should be correctly discovered by mypy and IDEs# VSCode requires explicit type annotationslist_aliases_paginator:ListAliasesPaginator=client.get_paginator("list_aliases")list_grants_paginator:ListGrantsPaginator=client.get_paginator("list_grants")list_key_policies_paginator:ListKeyPoliciesPaginator=client.get_paginator("list_key_policies")list_keys_paginator:ListKeysPaginator=client.get_paginator("list_keys")

键入的措辞

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

frommypy_boto3_kms.type_defsimport(AliasListEntryTypeDef,CancelKeyDeletionResponseTypeDef,CreateCustomKeyStoreResponseTypeDef,CreateGrantResponseTypeDef,CreateKeyResponseTypeDef,CustomKeyStoresListEntryTypeDef,DecryptResponseTypeDef,DescribeCustomKeyStoresResponseTypeDef,DescribeKeyResponseTypeDef,EncryptResponseTypeDef,GenerateDataKeyPairResponseTypeDef,GenerateDataKeyPairWithoutPlaintextResponseTypeDef,GenerateDataKeyResponseTypeDef,GenerateDataKeyWithoutPlaintextResponseTypeDef,GenerateRandomResponseTypeDef,GetKeyPolicyResponseTypeDef,GetKeyRotationStatusResponseTypeDef,GetParametersForImportResponseTypeDef,GetPublicKeyResponseTypeDef,GrantConstraintsTypeDef,GrantListEntryTypeDef,KeyListEntryTypeDef,KeyMetadataTypeDef,ListAliasesResponseTypeDef,ListGrantsResponseTypeDef,ListKeyPoliciesResponseTypeDef,ListKeysResponseTypeDef,ListResourceTagsResponseTypeDef,PaginatorConfigTypeDef,ReEncryptResponseTypeDef,ScheduleKeyDeletionResponseTypeDef,SignResponseTypeDef,TagTypeDef,VerifyResponseTypeDef,)defget_structure()->AliasListEntryTypeDef:return{...}

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

推荐PyPI第三方库


热门话题
java JNI和取消异步任务   java整数n作为List<String>的第二个参数传递。子列表(fromIndex,toIndex),但是stacktrace说toIndex在Kotlin中是n+2   如何在Java中正确嵌套多个ArrayList/Maps?   在嵌套条件语句中比较数组中的值时,java List没有打印正确的值   从CRON作业运行java代码   JRE使用jvisualvm检测到java致命错误   java将字符添加到BufferedReader中   带有枚举的java单例与带有双重检查锁定的单例   Java中的编译器构造基类的更改会影响子类的字节码吗?   Java作为Windows服务用户数据路径   java clone():ArrayList。克隆人()我认为它是一个肤浅的复制品   在jfilechooser多文件选择器启用中打开对话框后,java文件将显示所选文件   java在常用的操作方法中使用反射可以吗?   java ReloadableResourceBundleMessageSource。getMessage()不使用我给它的参数