{"id":3107,"library":"mypy-boto3-kendra","title":"mypy-boto3-kendra","description":"mypy-boto3-kendra provides static type annotations for the `boto3` AWS Kendra service client, enabling tools like MyPy to perform comprehensive static analysis on code interacting with AWS Kendra. It is a generated stub package, part of the larger `mypy-boto3` project which produces type stubs for all `boto3` services. The library is actively maintained and frequently updated, usually in sync with new `boto3` and `botocore` releases, currently at version 1.42.3.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["AWS","boto3","mypy","type-checking","kendra","stubs","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-kendra boto3","lang":"bash","label":"Install library and boto3"}],"dependencies":[{"reason":"Runtime dependency for interacting with AWS services; this library provides type stubs for it.","package":"boto3"},{"reason":"Required for type hints like `NotRequired` on Python versions older than 3.11.","package":"typing-extensions","optional":false}],"imports":[{"symbol":"KendraClient","correct":"from mypy_boto3_kendra.client import KendraClient"},{"wrong":"from mypy_boto3_kendra.type_defs import ListIndicesOutput","symbol":"ListIndicesOutputTypeDef","correct":"from mypy_boto3_kendra.type_defs import ListIndicesOutputTypeDef"},{"note":"Useful for explicit type annotations or passing service names.","symbol":"KendraServiceName","correct":"from mypy_boto3_kendra import KendraServiceName"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_kendra.client import KendraClient\nfrom mypy_boto3_kendra.type_defs import IndexConfigurationSummaryTypeDef, ListIndicesOutputTypeDef\nfrom typing import List\nimport os\n\ndef list_kendra_indices() -> List[IndexConfigurationSummaryTypeDef]:\n    \"\"\"Lists Kendra indices and returns their summaries.\"\"\"\n    # Ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)\n    # For explicit credential provision (if not using implicit chain):\n    # client: KendraClient = boto3.client(\n    #     \"kendra\",\n    #     aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''),\n    #     aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', ''),\n    #     region_name=os.environ.get('AWS_REGION', 'us-east-1')\n    # )\n    \n    client: KendraClient = boto3.client(\"kendra\")\n    \n    # Using type hints for the response\n    response: ListIndicesOutputTypeDef = client.list_indices()\n    \n    indices: List[IndexConfigurationSummaryTypeDef] = response.get('IndexConfigurationSummaryItems', [])\n    if indices:\n        print(f\"Found Kendra indices: {[i['Name'] for i in indices]}\")\n    else:\n        print(\"No Kendra indices found.\")\n    \n    return indices\n\nif __name__ == \"__main__\":\n    list_kendra_indices()","lang":"python","description":"This quickstart demonstrates how to use `mypy-boto3-kendra` with `boto3` to get type-checked interactions with the AWS Kendra service. It initializes a Kendra client and lists available indices, leveraging the `KendraClient` and `ListIndicesOutputTypeDef` type hints for static analysis."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher. For Python 3.8, use an older version of `mypy-boto3-kendra` if available, though this is not recommended due to security and feature updates.","message":"Python 3.8 is no longer supported. `mypy-boto3-builder` version 8.12.0 and subsequent versions (which generate `mypy-boto3-kendra` 1.42.3) removed Python 3.8 support.","severity":"breaking","affected_versions":"mypy-boto3-kendra >= 1.42.0 (generated by mypy-boto3-builder >= 8.12.0)"},{"fix":"Review your code for direct imports and usage of `mypy_boto3_kendra.type_defs` and adjust the `TypeDef` names according to the new naming conventions (e.g., `CreateDistributionRequestRequestTypeDef` might become `CreateDistributionRequestTypeDef`).","message":"TypeDefs for packed method arguments now use shorter names, and conflicting TypeDef `Extra` postfixes have moved. This is a breaking change for code that explicitly references generated `TypeDef` classes by their full names.","severity":"breaking","affected_versions":"mypy-boto3-kendra >= 1.39.0 (generated by mypy-boto3-builder >= 8.9.0)"},{"fix":"Always install `boto3` alongside `mypy-boto3-kendra` (e.g., `pip install boto3 mypy-boto3-kendra`).","message":"The `mypy-boto3-kendra` package provides only type stubs. You still need `boto3` installed at runtime to execute your code. This package enables type checking for `boto3` calls, not the `boto3` functionality itself.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Verify that your type checker (e.g., MyPy) correctly identifies and uses the `py.typed` marker files in the installed `mypy-boto3-kendra` package. No specific code change is typically needed, but be aware of potential environment or configuration impacts.","message":"Since `mypy-boto3` migrated to PEP 561, the generated packages are now proper stub packages. While generally an improvement, if you had a complex custom setup around older non-PEP 561 compliant versions or were relying on specific internal structures, it might require minor adjustments to your build or type-checking configuration.","severity":"gotcha","affected_versions":"mypy-boto3-kendra >= 1.42.0 (generated by mypy-boto3-builder >= 8.12.0)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}