Install & Compatibility
Where this runs
tested against v1.43.79 · 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
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 20MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.4s · import 0.000s · 20MB
18MB installed
● package 18MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
KafkaClient
✓ from mypy_boto3_kafka import KafkaClient
✗ from mypy_boto3_kafka import KafkaClient
Demonstrates how to import and use the KafkaClient type stub with a standard boto3 session to get type-hinted AWS MSK operations.
import os
import boto3
from mypy_boto3_kafka import KafkaClient
# Ensure boto3 is configured, e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME env vars
region = os.environ.get('AWS_REGION_NAME', 'us-east-1')
def get_kafka_client() -> KafkaClient:
session = boto3.Session(region_name=region)
client: KafkaClient = session.client('kafka')
return client
kafka_client = get_kafka_client()
response = kafka_client.list_clusters_v2()
print(f"Kafka Clusters: {response.get('ClusterInfoList')}")
Debug
Known issues
breakingThe underlying mypy-boto3-builder (version 8.12.0) has removed support for Python 3.8. Therefore, mypy-boto3-kafka no longer supports Python 3.8.fixUpgrade your Python environment to 3.9 or higher. The library specifies `requires_python: >=3.9`.
affects: mypy-boto3-kafka >= 1.42.65 (built with mypy-boto3-builder 8.12.0)
breakingmypy-boto3-builder version 8.9.0 introduced breaking changes to `TypeDef` naming conventions. Type definitions for packed method arguments use shorter names (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`), and conflicting `Extra` postfixes were moved (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`).fixReview explicit `TypeDef` imports and usage, updating names according to the new conventions if affected. Most users relying on IDE auto-completion for these should adapt automatically.
affects: mypy-boto3-kafka versions built with mypy-boto3-builder >= 8.9.0
gotchaThis package provides only type stubs. For actual runtime functionality, you must also install and configure the `boto3` library.fixEnsure `boto3` is installed alongside `mypy-boto3-kafka` (e.g., `pip install boto3 mypy-boto3-kafka`).
affects: All versions
gotchaWhen using PyCharm, performance issues with `Literal` overloads might occur. It's recommended to disable PyCharm's internal type checker or use `boto3-stubs-lite` variants for better performance.fixFor `mypy-boto3-kafka`, consider using the `types-boto3-lite[kafka]` package or disabling PyCharm's type checker and relying on an external tool like `mypy` or `pyright`.
affects: All versions (PyCharm specific)
gotchaFor Pylint compatibility and to avoid runtime dependencies on type stubs, it is common to guard imports with `if TYPE_CHECKING:` and set types to `object` in the `else` branch. Pylint might otherwise complain about undefined variables.fixUse a pattern like:
```python
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from mypy_boto3_kafka import KafkaClient
else:
KafkaClient = object
# Use KafkaClient
``` affects: All versions
Upgrade
Version history
1.43.79latest on PyPI · released Aug 24, 2026
Audit
Dependencies
boto3requiredProvides the runtime functionality for which these are type stubs.