aioworkers-kafka


Nameaioworkers-kafka JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
Summaryaioworkers plugin for kafka
upload_time2024-12-14 20:34:57
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseApache-2.0
keywords aioworkers
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            aioworkers-kafka
================

.. image:: https://img.shields.io/pypi/v/aioworkers-kafka.svg
  :target: https://pypi.org/project/aioworkers-kafka

.. image:: https://github.com/aioworkers/aioworkers-kafka/workflows/Tests/badge.svg
  :target: https://github.com/aioworkers/aioworkers-kafka/actions?query=workflow%3ATests

.. image:: https://codecov.io/gh/aioworkers/aioworkers-kafka/branch/master/graph/badge.svg
  :target: https://codecov.io/gh/aioworkers/aioworkers-kafka
  :alt: Coverage

.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v0.json
  :target: https://github.com/charliermarsh/ruff
  :alt: Code style: ruff

.. image:: https://img.shields.io/badge/types-Mypy-blue.svg
  :target: https://github.com/python/mypy
  :alt: Code style: Mypy

.. image:: https://readthedocs.org/projects/aioworkers-kafka/badge/?version=latest
  :target: https://github.com/aioworkers/aioworkers-kafka#readme
  :alt: Documentation Status

.. image:: https://img.shields.io/pypi/pyversions/aioworkers-kafka.svg
  :target: https://pypi.org/project/aioworkers-kafka
  :alt: Python versions

.. image:: https://img.shields.io/pypi/dm/aioworkers-kafka.svg
  :target: https://pypistats.org/packages/aioworkers-kafka

.. image:: https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg
  :alt: Hatch project
  :target: https://github.com/pypa/hatch


Usage
-----

config.yaml:

.. code-block:: yaml

    producer:
      cls: aioworkers_kafka.producer.KafkaProducer
      format: json
      kafka:
        bootstrap.servers: kafka:9092
      topic: test

    consumer:
      cls: aioworkers_kafka.consumer.KafkaConsumer
      format: json  # default format is json
      kafka:
        bootstrap.servers: kafka:9092
        group.id: test
      topics:
        - test

    worker:
      cls: mymodule.MyWorker
      input: .consumer
      output: .producer
      autorun: true


mymodule.py:

.. code-block:: python

    from aioworkers.worker.base import Worker

    class MyWorker(Worker):
        async def run(self, value):  # consume value from input
            assert isinstance(value, dict)

            value["test"] += 1

            return value  # produce value to output


.. code-block:: shell

    $ aioworkers -c config.yaml


Development
-----------

Check code:

.. code-block:: shell

    hatch run lint:all


Format code:

.. code-block:: shell

    hatch run lint:fmt


Run tests:

.. code-block:: shell

    hatch run pytest


Run tests with coverage:

.. code-block:: shell

    hatch run cov

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "aioworkers-kafka",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "aioworkers",
    "author": null,
    "author_email": "Alexander Malev <malev@somedev.ru>",
    "download_url": "https://files.pythonhosted.org/packages/94/00/829444230828cf6a74c42ff5b145fea9f4ce6607f37dbe5c5db99defb666/aioworkers_kafka-0.1.0.tar.gz",
    "platform": null,
    "description": "aioworkers-kafka\n================\n\n.. image:: https://img.shields.io/pypi/v/aioworkers-kafka.svg\n  :target: https://pypi.org/project/aioworkers-kafka\n\n.. image:: https://github.com/aioworkers/aioworkers-kafka/workflows/Tests/badge.svg\n  :target: https://github.com/aioworkers/aioworkers-kafka/actions?query=workflow%3ATests\n\n.. image:: https://codecov.io/gh/aioworkers/aioworkers-kafka/branch/master/graph/badge.svg\n  :target: https://codecov.io/gh/aioworkers/aioworkers-kafka\n  :alt: Coverage\n\n.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v0.json\n  :target: https://github.com/charliermarsh/ruff\n  :alt: Code style: ruff\n\n.. image:: https://img.shields.io/badge/types-Mypy-blue.svg\n  :target: https://github.com/python/mypy\n  :alt: Code style: Mypy\n\n.. image:: https://readthedocs.org/projects/aioworkers-kafka/badge/?version=latest\n  :target: https://github.com/aioworkers/aioworkers-kafka#readme\n  :alt: Documentation Status\n\n.. image:: https://img.shields.io/pypi/pyversions/aioworkers-kafka.svg\n  :target: https://pypi.org/project/aioworkers-kafka\n  :alt: Python versions\n\n.. image:: https://img.shields.io/pypi/dm/aioworkers-kafka.svg\n  :target: https://pypistats.org/packages/aioworkers-kafka\n\n.. image:: https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg\n  :alt: Hatch project\n  :target: https://github.com/pypa/hatch\n\n\nUsage\n-----\n\nconfig.yaml:\n\n.. code-block:: yaml\n\n    producer:\n      cls: aioworkers_kafka.producer.KafkaProducer\n      format: json\n      kafka:\n        bootstrap.servers: kafka:9092\n      topic: test\n\n    consumer:\n      cls: aioworkers_kafka.consumer.KafkaConsumer\n      format: json  # default format is json\n      kafka:\n        bootstrap.servers: kafka:9092\n        group.id: test\n      topics:\n        - test\n\n    worker:\n      cls: mymodule.MyWorker\n      input: .consumer\n      output: .producer\n      autorun: true\n\n\nmymodule.py:\n\n.. code-block:: python\n\n    from aioworkers.worker.base import Worker\n\n    class MyWorker(Worker):\n        async def run(self, value):  # consume value from input\n            assert isinstance(value, dict)\n\n            value[\"test\"] += 1\n\n            return value  # produce value to output\n\n\n.. code-block:: shell\n\n    $ aioworkers -c config.yaml\n\n\nDevelopment\n-----------\n\nCheck code:\n\n.. code-block:: shell\n\n    hatch run lint:all\n\n\nFormat code:\n\n.. code-block:: shell\n\n    hatch run lint:fmt\n\n\nRun tests:\n\n.. code-block:: shell\n\n    hatch run pytest\n\n\nRun tests with coverage:\n\n.. code-block:: shell\n\n    hatch run cov\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "aioworkers plugin for kafka",
    "version": "0.1.0",
    "project_urls": {
        "Documentation": "https://github.com/aioworkers/aioworkers-kafka#readme",
        "Homepage": "https://github.com/aioworkers/aioworkers-kafka",
        "Issues": "https://github.com/aioworkers/aioworkers-kafka/issues",
        "Source": "https://github.com/aioworkers/aioworkers-kafka"
    },
    "split_keywords": [
        "aioworkers"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8ed51f5bad4317165dc6989f8cac7b3de8246933c8bd2f316a0a817826dbd1a9",
                "md5": "bacdd4f0a25fd61bed5d7dd91c4719d4",
                "sha256": "e707fc01cf9a79997066d952ebdfaceb8ad0a499683e4f8fb71d5e7977479bd9"
            },
            "downloads": -1,
            "filename": "aioworkers_kafka-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bacdd4f0a25fd61bed5d7dd91c4719d4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 9771,
            "upload_time": "2024-12-14T20:34:54",
            "upload_time_iso_8601": "2024-12-14T20:34:54.730644Z",
            "url": "https://files.pythonhosted.org/packages/8e/d5/1f5bad4317165dc6989f8cac7b3de8246933c8bd2f316a0a817826dbd1a9/aioworkers_kafka-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9400829444230828cf6a74c42ff5b145fea9f4ce6607f37dbe5c5db99defb666",
                "md5": "0e83e0027207c21b658542a31771e5e6",
                "sha256": "a8211bd7fccc5a251797b497cd9d89a2bd275d78be9b52f9dab41c724401c499"
            },
            "downloads": -1,
            "filename": "aioworkers_kafka-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0e83e0027207c21b658542a31771e5e6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 9974,
            "upload_time": "2024-12-14T20:34:57",
            "upload_time_iso_8601": "2024-12-14T20:34:57.081203Z",
            "url": "https://files.pythonhosted.org/packages/94/00/829444230828cf6a74c42ff5b145fea9f4ce6607f37dbe5c5db99defb666/aioworkers_kafka-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-14 20:34:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aioworkers",
    "github_project": "aioworkers-kafka#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aioworkers-kafka"
}
        
Elapsed time: 0.53163s