--- id: aiokafka version: "0.14.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # aiokafka — Kafka integration with asyncio License: permissive · Maintenance: active · Downloads: 10.5M/mo ## What it is and what it does aiokafka is an asyncio-native client for Apache Kafka that lets you produce and consume messages using Python's async/await syntax. It provides two main classes: AIOKafkaProducer for sending messages asynchronously and AIOKafkaConsumer for subscribing to topics and processing messages in an async loop. The consumer supports group coordination for load-balanced consumption across multiple consumer instances. The library is built on top of asyncio and integrates with the async ecosystem, making it suitable for applications that already use async patterns. It handles cluster discovery, partition leadership, and group management automatically. The package depends on async-timeout, packaging, and typing_extensions, and supports Python 3.10 through 3.14. Use it for: - Build async event-driven applications that consume from Kafka topics and process messages concurrently. - Implement high-throughput asynchronous message producers for real-time data pipelines. - Create microservices that coordinate via Kafka consumer groups with automatic load balancing. - Integrate Kafka messaging into FastAPI or other async web frameworks for event streaming. - Process streaming data in async Python applications without blocking the event loop. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. aiokafka is an asyncio-based client library for Apache Kafka that provides asynchronous producer and consumer APIs for publishing and consuming messages. Yes. aiokafka is actively maintained, has no known vulnerabilities, and offers a clean async API for Kafka integration. The medium install friction is standard for compiled packages. Choose it if you need Kafka support in an asyncio-based application; it's the primary async Kafka client for Python. ## Install pip install aiokafka uv add aiokafka poetry add aiokafka ## Installing aiokafka Before you install: Medium install friction due to compiled wheels across multiple Python versions and platforms. The package is actively maintained with a recent release and 1397 repository stars, indicating stable ongoing support. License in practice: Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions beyond attribution and liability disclaimers. Quickstart: pip install aiokafka from aiokafka import AIOKafkaProducer import asyncio async def send(): producer = AIOKafkaProducer(bootstrap_servers='localhost:9092') await producer.start() await producer.send_and_wait("my_topic", b"message") await producer.stop() asyncio.run(send()) Requires a running Kafka broker accessible at the bootstrap_servers address; requires Python 3.10 or later. Verify before relying: - Whether the package supports Kafka protocol versions beyond 0.11 mentioned in the consumer documentation. - Performance characteristics and throughput limits under typical production loads. - Compatibility with Kafka security features (SASL, SSL/TLS) beyond what the description mentions. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 10.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags asyncio kafka client, async message producer consumer, kafka async integration, aiokafka producer consumer, asynchronous kafka messaging, kafka asyncio library, async kafka broker client, async-messaging, kafka-client, event-streaming [View on SkillFed](https://skillfed.io/packages/aiokafka) · [View on PyPI](https://pypi.org/project/aiokafka/)