Skip to main content
https://github.com/lostclus/django-kafka-streamer/actions/workflows/tests.yml/badge.svg Documentation 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

The data streamed to the model-a Kafka topic has following structure:

{
    "_time": "2023-01-01T00:00:00Z",
    "_type": "create",
    "id": 1,
    "field1": 1,
    "field2": "abc"
}

Metadata

Release files for django-kafka-streamer 1.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-kafka-streamer 1.4.1
File Size Uploaded Provenance Actions
django_kafka_streamer-1.4.1.tar.gz 30.3 kB Without provenance Details for django_kafka_streamer-1.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-kafka-streamer 1.4.1
File Interpreter ABI Platform Actions
django_kafka_streamer-1.4.1-py3-none-any.whl Python 3 none any Details for django_kafka_streamer-1.4.1-py3-none-any.whl

Total release size: 50.6 kB

Release files / django_kafka_streamer-1.4.1.tar.gz

Download URL django_kafka_streamer-1.4.1.tar.gz
Size 30.3 kB
Tags Source
SHA-256 checksum
How to use checksums
20c043e6f9d865ea32ef9ef9182e07e7be167e8cc28121fb8ca311cfb5e50167
BLAKE2b-256 checksum
How to use checksums
6c2b4e2d275d5bb570e44c8b5af07bcdfea38824afc83d507e1c0955445d9421
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / django_kafka_streamer-1.4.1-py3-none-any.whl

Download URL django_kafka_streamer-1.4.1-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23e672a79d39af08834c57a3434f687d30ae02d8285805953fd39414619e82b2
BLAKE2b-256 checksum
How to use checksums
c8f12e1305181f75ede74762d058dd79d3d5506fedabc61f5e872fadff5d0b60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Security for django-kafka-streamer 1.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page