Skip to main content

使用 mypy-boto3-builder 7.11.10 生成的 aiobotocore.LexRuntimeService 2.4.0 服务的类型注释

项目描述

类型-aiobotocore-lex-运行时

PyPI - 类型-aiobotocore-lex-runtime PyPI - Python 版本 文档 PyPI - 下载

boto3.typed

为aiobotocore.LexRuntimeService 2.4.0服务键入注释, 兼容VSCodePyCharmEmacsSublime Textmypypyright和其他工具。

mypy-boto3-builder 7.11.10 生成

更多信息可以在 types-aiobotocore页面和 types-aiobotocore-lex-runtime 文档中找到。

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

boto3-stubs 演示

如何安装

来自带有 pip 的 PyPI

安装types-aiobotocore服务LexRuntimeService

# install with aiobotocore type annotations
python -m pip install 'types-aiobotocore[lex-runtime]'


# Lite version does not provide session.client/resource overloads
# it is more RAM-friendly, but requires explicit type annotations
python -m pip install 'types-aiobotocore-lite[lex-runtime]'


# standalone installation
python -m pip install types-aiobotocore-lex-runtime

如何卸载

python -m pip uninstall -y types-aiobotocore-lex-runtime

用法

VSCode

  • 安装 Python 扩展
  • 安装 Pylance 扩展
  • 设置Pylance为您的 Python 语言服务器
  • types-aiobotocore[lex-runtime]在您的环境中安装:
python -m pip install 'types-aiobotocore[lex-runtime]'

类型检查和代码完成现在都应该可以工作了。不需要显式类型注释,aiobotocore像往常一样编写代码。

PyCharm

types-aiobotocore-lite[lex-runtime]在您的环境中安装:

python -m pip install 'types-aiobotocore-lite[lex-runtime]'`

类型检查和代码完成现在都应该可以工作了。需要显式类型注释。

使用types-aiobotocore包代替隐式类型发现。

Emacs

  • 安装types-aiobotocore您在环境中使用的服务:
python -m pip install 'types-aiobotocore[lex-runtime]'
(use-package lsp-pyright
  :ensure t
  :hook (python-mode . (lambda ()
                          (require 'lsp-pyright)
                          (lsp)))  ; or lsp-deferred
  :init (when (executable-find "python3")
          (setq lsp-pyright-python-executable-cmd "python3"))
  )
  • 确保 emacs 使用您安装的环境 types-aiobotocore

类型检查现在应该可以工作了。不需要显式类型注释,aiobotocore像往常一样编写代码。

崇高的文本

  • 安装types-aiobotocore[lex-runtime]您在环境中使用的服务:
python -m pip install 'types-aiobotocore[lex-runtime]'

类型检查现在应该可以工作了。不需要显式类型注释,aiobotocore像往常一样编写代码。

其他 IDE

未经测试,但只要您的 IDE 支持mypyor pyright,一切都应该工作。

我的

  • 安装mypypython -m pip install mypy
  • types-aiobotocore[lex-runtime]在您的环境中安装:
python -m pip install 'types-aiobotocore[lex-runtime]'`

类型检查现在应该可以工作了。不需要显式类型注释,aiobotocore像往常一样编写代码。

版权

  • 安装pyrightnpm i -g pyright
  • types-aiobotocore[lex-runtime]在您的环境中安装:
python -m pip install 'types-aiobotocore[lex-runtime]'

或者,您可以安装types-aiobotocoretypings文件夹。

类型检查现在应该可以工作了。不需要显式类型注释,aiobotocore像往常一样编写代码。

显式类型注释

客户端注释

LexRuntimeServiceClientsession.create_client("lex-runtime").

from aiobotocore.session import get_session

from types_aiobotocore_lex_runtime import LexRuntimeServiceClient

session = get_session()
async with session.create_client("lex-runtime") as client:
    client: LexRuntimeServiceClient
    # now client usage is checked by mypy and IDE should provide code completion

字面量

types_aiobotocore_lex_runtime.literals模块包含从形状中提取的文字,可在用户代码中用于类型检查。

from types_aiobotocore_lex_runtime.literals import (
    ConfirmationStatusType,
    ContentTypeType,
    DialogActionTypeType,
    DialogStateType,
    FulfillmentStateType,
    MessageFormatTypeType,
    LexRuntimeServiceServiceName,
    ServiceName,
    ResourceServiceName,
    RegionName,
)


def check_value(value: ConfirmationStatusType) -> bool:
    ...

打字字典

types_aiobotocore_lex_runtime.type_defs模块包含组装到类型化字典的结构和形状,以进行额外的类型检查。

from types_aiobotocore_lex_runtime.type_defs import (
    ActiveContextTimeToLiveTypeDef,
    ButtonTypeDef,
    DeleteSessionRequestRequestTypeDef,
    ResponseMetadataTypeDef,
    DialogActionTypeDef,
    GetSessionRequestRequestTypeDef,
    IntentSummaryTypeDef,
    IntentConfidenceTypeDef,
    PostContentRequestRequestTypeDef,
    SentimentResponseTypeDef,
    ActiveContextTypeDef,
    GenericAttachmentTypeDef,
    DeleteSessionResponseTypeDef,
    PostContentResponseTypeDef,
    PutSessionResponseTypeDef,
    PredictedIntentTypeDef,
    GetSessionResponseTypeDef,
    PostTextRequestRequestTypeDef,
    PutSessionRequestRequestTypeDef,
    ResponseCardTypeDef,
    PostTextResponseTypeDef,
)


def get_structure() -> ActiveContextTimeToLiveTypeDef:
    return {...}

这个怎么运作

全自动 的mypy-boto3-builder为每个服务仔细生成类型注解,耐心等待 aiobotocore更新。它为您提供插入式注释,并确保:

  • 涵盖所有可用aiobotocore服务。
  • 每个aiobotocore服务的每个公共类和方法都会从文档中提取有效的类型注释(botocore如果类型不正确,请归咎于文档)。
  • 类型注释包括最新的文档。
  • 每种方法都提供了文档链接。
  • 为了可读性,代码由blackisort处理。

什么是新的

实现的功能

  • 全类型注释boto3botocoreaiobotocore
  • mypy, pyright, VSCode, PyCharm,Sublime TextEmacs 兼容性
  • Client, ServiceResource, Resource,Waiter Paginator为每个服务键入注释
  • TypeDefs为每个服务生成
  • Literals为每个服务生成
  • 自动发现类型boto3.clientboto3.session调用
  • 自动发现类型session.clientsession.session调用
  • 自动发现类型client.get_waiterclient.get_paginator 调用
  • 自动发现类型ServiceResourceResource集合
  • 自动发现aiobotocore.Session.create_client呼叫类型

最新变化

生成器更改日志可以在 Releases中找到。

版本控制

types-aiobotocore-lex-runtime版本与相关aiobotocore 版本相同,遵循PEP 440 格式。

谢谢

文档

所有服务类型注释都可以在 aiobotocore 文档中找到

支持和贡献

这个包是自动生成的。请在mypy-boto3-builder存储库中报告任何错误或请求新功能 。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

types-aiobotocore-lex-runtime-2.4.0.post1.tar.gz (15.2 kB 查看哈希

已上传 source

内置分布

types_aiobotocore_lex_runtime-2.4.0.post1-py3-none-any.whl (19.9 kB 查看哈希

已上传 py3