Skip to main content

Asynchronous wrappers for kafka-python, integrating Kafka with Python's asyncio.

Project description

kafkoroutine

This repository offers Python-based asynchronous wrappers around kafka-python's Producer and Consumer, bridging them seamlessly with Python's asyncio.

Prerequisites

  • Python 3.7 or later
  • A running Kafka instance (for actual message passing)

Getting Started

Follow these instructions to integrate the asynchronous Kafka components in your asyncio-based Python project.

Installation

Install kafkoroutine using pip:

pip install kafkoroutine

Please note: this project requires Python 3.7 or later and is built upon the kafka-python library.

Usage

AsyncKafkaConsumer

from kafkoroutine.consumer import AsyncKafkaConsumer

async with AsyncKafkaConsumer(topics, executor, bootstrap_servers='localhost:9092') as consumer:
    async for message in consumer:
        print(f"Received: {message.value.decode('utf-8')}")

AsyncKafkaProducer

from kafkoroutine.producer import AsyncKafkaProducer

async with AsyncKafkaProducer(executor, bootstrap_servers='localhost:9092') as producer:
    for msg in messages:
        await producer.send(topic, msg)

Built With

  • Poetry - Packaging and dependency management
  • asyncio - Asynchronous I/O, event loop, and coroutines used for the implementation.
  • kafka-python - The Python client for Apache Kafka upon which these asynchronous wrappers are built.

License

This project follows the guidelines of the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kafkoroutine-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

kafkoroutine-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file kafkoroutine-0.1.0.tar.gz.

File metadata

  • Download URL: kafkoroutine-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.0 Linux/5.15.0-1042-azure

File hashes

Hashes for kafkoroutine-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2b91a0176e2e64eb9de4277af799377878d5aa591d3c6a6e054f8b48b0b761c7
MD5 b50079e90aae16068eb49bd00a52a3ea
BLAKE2b-256 c606024f2c66d14c130e9201bb61d822972df4b5ba0c8f08f69edd64722997cd

See more details on using hashes here.

File details

Details for the file kafkoroutine-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kafkoroutine-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.0 Linux/5.15.0-1042-azure

File hashes

Hashes for kafkoroutine-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a201c68e6257858c68de7a8aa327b6e0e65c02f5c457c5c8cc42b060d29011e7
MD5 e127458b40c5fdb06287cbf7abe8e028
BLAKE2b-256 ec546fa8651f67c22609386eb42294742b2855d2836be147940d714f8f03a456

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page