Skip to content

Kafka module#

Index > Kafka

Auto-generated documentation for Kafka type annotations stubs module types-boto3-kafka.

How to install#

You can generate type annotations for boto3 package locally with mypy_boto3_builder. Use uv for build isolation.

  1. Run mypy-boto3-builder in your package root directory: uvx --with 'boto3==1.35.86' mypy_boto3_builder
  2. Select boto3 AWS SDK.
  3. Add Kafka service.
  4. Use provided commands to install generated packages.

VSCode extension#

Add AWS Boto3 extension to your VSCode and run AWS boto3: Quick Start command.

Click Modify and select boto3 common and Kafka.

From PyPI with pip#

Install types-boto3 for Kafka service.

# install with boto3 type annotations
python -m pip install 'types-boto3[kafka]'

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

# standalone installation
python -m pip install types-boto3-kafka

How to uninstall#

python -m pip uninstall -y types-boto3-kafka

Usage#

Code samples can be found in Examples.

KafkaClient#

Type annotations and code completion for boto3.client("kafka") as KafkaClient boto3 documentation

# KafkaClient usage example

from boto3.session import Session

from types_boto3_kafka.client import KafkaClient

def get_client() -> KafkaClient:
    return Session().client("kafka")

Paginators#

Type annotations and code completion for paginators from boto3.client("kafka").get_paginator("...").

# ListClientVpcConnectionsPaginator usage example

from boto3.session import Session

from types_boto3_kafka.paginator import ListClientVpcConnectionsPaginator

def get_list_client_vpc_connections_paginator() -> ListClientVpcConnectionsPaginator:
    return Session().client("kafka").get_paginator("list_client_vpc_connections"))

Literals#

Type annotations for literals used in methods and schema.

# BrokerAZDistributionType usage example

from types_boto3_kafka.literals import BrokerAZDistributionType

def get_value() -> BrokerAZDistributionType:
    return "DEFAULT"

Type definitions#

Type annotations for type definitions used in methods and schema.