Django + Pydantic + Kafka
Project description
djpykafka
🚧 This project is WIP and is subject to change at any time
This project is currently in the alpha state, even though it can be used in production with some caution. Make sure to fix the version in your requirements.txt and review changes frequently.
Installation
pip install djpykafka
Examples
Add the KafkaPublishMixin
to your model class.
from django.db import models
from djpykafka.models import KafkaPublishMixin
class MyModel(KafkaPublishMixin, models.Model):
...
Create a publisher class, e.g. at events/publish/{modelname_plural}.py
from djpykafka.events.publish import EventPublisher, DataChangePublisher
from ... import models
from ...schemas import response
from . import connection
class MyModelPublisher(
DataChangePublisher,
EventPublisher,
orm_model=models.MyModel,
event_schema=response.MyModel,
connection=connection,
topic='bizberry.access.users',
data_type='access.user',
):
pass
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
djpykafka-0.0.14.tar.gz
(18.5 kB
view hashes)
Built Distribution
djpykafka-0.0.14-py3-none-any.whl
(20.6 kB
view hashes)
Close
Hashes for djpykafka-0.0.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2337ef4bcec651178fa654780b200206b21766cf3ad76f92794be0927635203 |
|
MD5 | 7a89ae288f944355437e4e90e6c2f3c8 |
|
BLAKE2b-256 | 1d28519052b346d9a6856b59cbdad777af85be8fa6f70952de4268be94ed3ad0 |