kafka-python is a pure-Python client library for Apache Kafka that provides consumer, producer, and admin client functionality without external dependencies or compiled extensions.
The library solves the problem of connecting Python applications to Apache Kafka clusters. It implements high-level consumer and producer classes designed to behave similarly to the official Java client, allowing developers to produce and consume messages with straightforward APIs. The consumer supports both standalone operation and consumer group membership with dynamic partition assignment and offset management. The tool includes CLI scripts for interactive tasks like creating topics, producing messages, and consuming messages, offering a lightweight alternative to Kafka's bin scripts when a JVM is unavailable or inconvenient.
Developers should choose this tool if they need a dependency-light Kafka client for Python environments where installation simplicity matters. It suits projects that do not require maximum throughput, though the optional crc32c dependency can offload CPU-intensive checksum computation to an optimized C library for improved performance. The pure-Python implementation makes it portable across diverse environments without compilation overhead.
Issues and pull requests often wait weeks or longer for a first response. Work in the issue tracker is dominated by consumer, producer, and admin-client concerns, reflecting the core functionality areas that receive the most attention.