a simple sdk to send notifications on queue for celery tasks
Project description
Kaftar SDK
Usage
Package installation
pip install kaftar
Usage:
import uuid
from kaftar import Notification
app = Notification('app_name')
message_uuid = uuid.uuid4()
recipients = [
{
'receiver': "076f08cc-4122-400a-bffa-2a0157ba57eb", # can be email or phone number
'message_uuid': str(message_uuid),
'uuid': "076f08cc-4122-400a-bffa-2a0157ba57eb"
}
]
app.send_notification(
{
'subject': 'Course updated222',
'content': 'Course is available now'
},
[
{
'receiver': "076f08cc-4122-400a-bffa-2a0157ba57eb", # can be email or phone number
'message_uuid': str(message_uuid),
'uuid': "076f08cc-4122-400a-bffa-2a0157ba57eb"
}
],
int(time.time()),
group_uuid=uuid.uuid4() # Optional
)
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
kaftar-0.0.6.tar.gz
(2.0 kB
view hashes)
Built Distribution
kaftar-0.0.6-py3-none-any.whl
(2.2 kB
view hashes)