Skip to main content

⚠️ This package is no longer maintained. No future updates will be released.

Project description

codecov GitHub PyPI PyPI - Python Version

⚠️ This project is archived and no longer maintained. ⚠️

This repository and the associated PyPI package (kafkoroutine) are no longer supported. No future updates will be released.

Feel free to fork or take over maintenance if needed.

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=topics, bootstrap_servers='localhost:9092', executor=None) as consumer:
    async for message in consumer:
        print(f"Received: {message.value.decode('utf-8')}")

AsyncKafkaProducer

from kafkoroutine.producer import AsyncKafkaProducer

async with AsyncKafkaProducer(bootstrap_servers='localhost:9092', executor=None) 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.7.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kafkoroutine-0.1.7-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kafkoroutine-0.1.7.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.1 Linux/6.11.0-1015-azure

File hashes

Hashes for kafkoroutine-0.1.7.tar.gz
Algorithm Hash digest
SHA256 edaf48b9df60b4667761c211e3ca82f451dfb2cf261323b93dfafa884db4a6e8
MD5 e82afc382537ba3e2b125e219fbccac6
BLAKE2b-256 6d034202662fe8923f49c2fef8b7e77f4d303ccbbc7ec86ca6a29ee9bee24f6a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kafkoroutine-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.1 Linux/6.11.0-1015-azure

File hashes

Hashes for kafkoroutine-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c1312f143a9f881c8c667d393415442c15c0e631c5f8d9a1596dc6d249e4572a
MD5 1f2a2eb5cb1983df3c43de3c6490484b
BLAKE2b-256 4917afc6e50ff006371b2742d4c9e743bd3761438c65b89b21ed4240c14b5c80

See more details on using hashes here.

Supported by

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