skillfed

confluent-kafka-stubs

Stub files for confluent-kafka.

confluent-kafka-stubs v0.0.3 1.2M downloads/30d#4,267 on PyPI
Permissive license Apache-2.0 Abandoned released

What it is and what it does

confluent-kafka-stubs is a type-stub-only package that adds Python type hints to the confluent-kafka library. It contains no runtime code—only .pyi stub files—and is designed to be installed alongside confluent-kafka so that type checkers like mypy and language servers can understand the types in confluent-kafka's API.

The package covers core classes and functions in the cimpl module (KafkaError, KafkaException, Message, Producer, Consumer, and others) but is explicitly incomplete. The maintainer notes it as a work in progress, and the project has not been updated since its initial release. It requires Python 3.11 or later and is not officially endorsed by Confluent.

Use it for:

  • Enable mypy type checking on code that uses confluent-kafka producers and consumers
  • Get IDE autocompletion and type hints for confluent-kafka classes like Producer and Consumer
  • Catch type errors in Kafka client code during development rather than at runtime
  • Improve code documentation and maintainability by making confluent-kafka's API types explicit

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides type hints and stubs for the confluent-kafka package to enable static type checking with mypy and IDE autocompletion.

Yes, if you need type checking for confluent-kafka and can tolerate incomplete coverage. The low install friction and permissive license make it a low-risk addition to a type-checking workflow. However, the abandoned status and 1159-day gap since the last release mean you should verify that the stubs remain compatible with your confluent-kafka version and accept that some modules and classes may lack type hints.

Install

confluent-kafka-stubs on PyPI

pip

pip install confluent-kafka-stubs

uv

uv add confluent-kafka-stubs

poetry

poetry add confluent-kafka-stubs

Installing confluent-kafka-stubs

Before you install

Installation is straightforward with no runtime dependencies. However, the package is abandoned—last release was 1159 days ago—and marked as a work in progress with incomplete type coverage.

License in practice

Licensed under Apache-2.0 (permissive), so you can use it freely in commercial and open-source projects without significant restrictions.

Quickstart

pip install confluent-kafka-stubs

# In your Python code with mypy enabled:
from confluent_kafka import Producer
producer: Producer = Producer({})

Requires Python 3.11 or later; confluent-kafka must be installed separately for the stubs to be useful.

Verify before relying

  • Whether type coverage has improved or regressed since the last release
  • Whether the stubs remain compatible with recent confluent-kafka versions
  • Whether _AdminClientImpl and unlisted modules have been typed in practice by users

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.11,<4.0)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 1,159 days since the last release
First released
Downloads 1,173,132/month — #4,267 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: confluent_kafka_stubs-0.0.3-py3-none-any.whl

Keywords: kafka, stubs, types

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Typing :: Stubs Only

Tags

type stubs for confluent-kafkamypy type hints kafkaconfluent kafka typing supportkafka type checkingpython kafka stubs
type-stubsmypykafka

More Software Development packages

typing-extensions

Provides backported and experimental type hints…

permissive · top 100 on PyPI

numpy

NumPy provides an N-dimensional array object…

permissive · top 100 on PyPI

fastapi

FastAPI is a Python web framework for building…

permissive · top 100 on PyPI

annotated-doc

Provides a way to document function parameters,…

permissive · top 100 on PyPI

typer

Typer builds command-line applications from…

permissive · top 1,000 on PyPI

distlib

Distlib provides low-level packaging utilities…

permissive · top 1,000 on PyPI

types-confluent-kafka

Provides type hints and stub files for the…

permissive · top 5,000 on PyPI

mypy-boto3-kafka

Provides type annotations and IDE…

permissive · top 15,000 on PyPI

pyspark-stubs

Provides type stubs for PySpark to enable…

permissive · top 15,000 on PyPI

ob-metaflow-stubs

Provides type hints and stub files for the…

permissive · top 15,000 on PyPI

confluent-kafka

Provides a high-performance Python client for…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-confluent-kafka

Adds distributed tracing to confluent-kafka…

permissive · top 5,000 on PyPI

confluent_avro

Serializes and deserializes Avro data according…

permissive · top 15,000 on PyPI

kafka

A pure-Python client library for Apache Kafka…

permissive · top 15,000 on PyPI

kafka-schema-registry

Integrates Kafka with Confluent Schema Registry…

permissive · top 15,000 on PyPI

kafka-python-ng

A Python client library for Apache Kafka that…

permissive · top 5,000 on PyPI