Skip to main content

Stream data to Apache Kafka.

Project description

https://github.com/lostclus/django-kafka-streamer/actions/workflows/tests.yml/badge.svg Current version on PyPi PyPI - Python Version PyPI - Django Version Published on Django Packages

django-kafka-streamer is a Django application and library for streaming data to Apache Kafka.

Features:

  • Setup signal handlers to ORM models to transparently send create/update/delete events to Kafka

  • Handle database object relations

  • Celery task to stream large amount of data in background

Links:

Usage:

yourapp/models.py:

from django.db import models

class MyModel(models.Model):
    field1 = models.IntegerField()
    field2 = models.CharField(max_length=10)

yourapp/stramers.py:

from kafkastreamer import Streamer, register
from .models import MyModel

@register(MyModel)
class MyModelStreamer(Streamer):
    topic = "model-a"

yourproject/settings.py:

INSTALLED_APPS = [
    ...
    "kafkastreamer",
]

KAFKA_STREAMER = {
    "BOOTSTRAP_SERVERS": ["localhost:9092"],
},

Any changes in MyModel data will be automatically streamed to Kafka. To force stream all data in all registered models type:

python manage.py kafkastreamer_refresh

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

django_kafka_streamer-1.4.0.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

django_kafka_streamer-1.4.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file django_kafka_streamer-1.4.0.tar.gz.

File metadata

  • Download URL: django_kafka_streamer-1.4.0.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for django_kafka_streamer-1.4.0.tar.gz
Algorithm Hash digest
SHA256 7da8429ece00266df2dfdad8fa368877ec47115dd61cfbce087d4047928aabc0
MD5 4498068ffd64e9ea78c57b1d32d08bc0
BLAKE2b-256 c2947a516c2a1df96f5a43da0b753d31f77b0f3efc296c9edaa6e7d31332324a

See more details on using hashes here.

File details

Details for the file django_kafka_streamer-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_kafka_streamer-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f62ccc9826ccc793c249830b5d50962d4098de918871331e0f92071ac888bf4
MD5 03133a14e30359d76b32dd1456f48a13
BLAKE2b-256 68b8a7e433eca9686bb0256fd955780ab52692d40d2cc2ddc2bdcf1a45d50c2c

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