Stream data to Apache Kafka.
Project description
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
Built Distribution
File details
Details for the file django_kafka_streamer-1.3.1.tar.gz
.
File metadata
- Download URL: django_kafka_streamer-1.3.1.tar.gz
- Upload date:
- Size: 23.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 441226353f082301b84b19477007636a1dfc002773b1f300c83ca998bea1a7b0 |
|
MD5 | 70a6e05fb83ef918d818bddb437108ba |
|
BLAKE2b-256 | 07fafbb7ea87c2897eb3d80b4fe94c4ec67b0fab7a6aedc2a8c0ea4f5f605f9b |
File details
Details for the file django_kafka_streamer-1.3.1-py3-none-any.whl
.
File metadata
- Download URL: django_kafka_streamer-1.3.1-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a2c8ac85449d0f5fb620e04e95c246d10d5df4cd2d6ea69ad7218c386128e8b |
|
MD5 | 2863f012bbf8f22c1c99ee9d800c304d |
|
BLAKE2b-256 | 19c4cc80a1fa10b6a93a0caeccc3a116a4122044a0affcc301692f80258a3d66 |