Registry / type-stubs / types-boto3-kms

types-boto3-kms

JSON →
library1.43.12pypypiunverified

types-boto3-kms provides static type annotations for the `boto3` AWS SDK's Key Management Service (KMS) client, compatible with static analysis tools like Mypy, Pyright, and IDEs such as VSCode and PyCharm. It enhances `boto3` code with autocompletion, type checking, and early error detection for KMS operations. This package is part of the `mypy-boto3-builder` ecosystem, currently at version 1.42.50, and releases are frequently updated to match `boto3` versions.

pip install types-boto3-kms boto3
INSTALL
IMPORT
SIG · TYPES-BOTO3-KMS
T
types-boto3-kms
type-stubspythonv1.43.12
Install
5.3s avg
Import
11ms
Disk
52MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.12 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
installs and imports cleanly · install 0.0s · import 0.010s · 53.2MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 5.3s · import 0.006s · 54MB
52MB installed
● package 52MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

KMSClient
from typing import TYPE_CHECKING if TYPE_CHECKING: from mypy_boto3_kms.client import KMSClient
Importing KMSClient directly without `TYPE_CHECKING` will make `types-boto3-kms` a runtime dependency, which is usually unnecessary and adds overhead.
ListKeysResponseTypeDef
from typing import TYPE_CHECKING if TYPE_CHECKING: from mypy_boto3_kms.type_defs import ListKeysResponseTypeDef
Specific TypeDefs provide precise type checking for boto3 response structures.

This quickstart demonstrates how to use `types-boto3-kms` to add type hints to a `boto3` KMS client. It shows how to import and apply type annotations for the client object and its response structures, enabling static analysis and IDE assistance for KMS API calls. Requires AWS credentials configured to execute.

from typing import TYPE_CHECKING, List import boto3 if TYPE_CHECKING: from mypy_boto3_kms.client import KMSClient from mypy_boto3_kms.type_defs import KeyListEntryTypeDef, ListKeysResponseTypeDef def get_kms_key_ids() -> List[str]: """Lists all KMS key IDs in the current AWS account.""" kms_client: KMSClient = boto3.client("kms") # The response object is type-hinted for better autocompletion and error checking response: ListKeysResponseTypeDef = kms_client.list_keys() key_ids: List[str] = [] for key_entry in response.get("Keys", []): # key_entry is inferred as KeyListEntryTypeDef if 'KeyId' in key_entry: key_ids.append(key_entry['KeyId']) return key_ids # To run this function, ensure AWS credentials are configured (e.g., via environment variables, AWS CLI, or IAM role). # print(get_kms_key_ids())
Debug
Known issues
breakingPython 3.8 support has been removed in `mypy-boto3-builder` version 8.12.0 (and thus `types-boto3-kms`). Projects using Python 3.8 will not receive updates or new packages.
fix
Upgrade your Python environment to 3.9 or newer.
affects: >=8.12.0
deprecatedThe legacy `mypy-boto3` package, which contained stubs for all services in one package, has been deprecated in favor of the modular `types-boto3` and service-specific packages like `types-boto3-kms`.
fix
Uninstall `mypy-boto3` and install `types-boto3-kms` for specific service stubs, or `types-boto3[all]` for all services.
affects: All versions since `types-boto3` was introduced as successor.
gotchaForgetting the `if TYPE_CHECKING:` guard when importing client types (e.g., `from mypy_boto3_kms.client import KMSClient`) can inadvertently make `types-boto3-kms` a runtime dependency for your application, which is unnecessary and adds overhead.
fix
Always wrap type-only imports within an `if TYPE_CHECKING:` block, as shown in the quickstart and import examples.
affects: All
gotchaPyCharm's performance can be slow with `Literal` overloads in `mypy-boto3` packages (issue PY-40997). This can lead to sluggish autocompletion or analysis.
fix
Consider using `types-boto3-lite` (e.g., `pip install types-boto3-lite[kms]`) which is more RAM-friendly but requires explicit type annotations, until the PyCharm issue is resolved.
affects: All
Upgrade
Version history
1.43.12latest on PyPI · released May 20, 2026
Audit
Dependencies
boto3requiredRuntime dependency; this package provides type stubs for boto3.
mypyoptionalRecommended for static type checking integration.
Agent activity
30 hits · last 30 days
node
26
OpenAI (training)
1
Resources
types-boto3-kms — pip install types-boto3-kms · libregistry