a simple sdk to send notifications on queue for celery tasks
Project description
Kaftar SDK
Usage
Package installation
pip install kaftar
Usage:
import uuid
import time
from kaftar import Notification
message_uuid = uuid.uuid4()
group_uuid = uuid.uuid4()
broker_url = "BROKER_URL_HERE"
app = Notification('app_name', broker_url)
app.send_notification(
{
'subject': 'Notification title goes here',
'content': 'Notification body goes here'
},
[
{
'receiver': "076f08cc-4122-400a-bffa-2a0157ba57eb", # can be email or phone number
'message_uuid': str(message_uuid), # Optional (task will generate an id if not provided here)
'uuid': "076f08cc-4122-400a-bffa-2a0157ba57eb"
}
],
int(time.time()),
group_uuid=group_uuid # Optional
)
# Delete single notification
app.delete_notification(message_uuid)
# Delete group of notifications
app.delete_group_notification(group_uuid)
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.2.2.tar.gz
(2.3 kB
view details)
Built Distribution
File details
Details for the file kaftar-0.2.2.tar.gz
.
File metadata
- Download URL: kaftar-0.2.2.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66d660fc4709563208ccdf3cd7452ce21946d75f6777e4e409b3ff1d3251da1e |
|
MD5 | 57b6c36e65511fb2bf192859021ca43e |
|
BLAKE2b-256 | df237e3c94d079e6bf655cc7db91eade27a0e327c4f560d8cfe7edc0688b0471 |
File details
Details for the file kaftar-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: kaftar-0.2.2-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 460b1ce3e811948e4f51eda594f2a7e073351715576f7f50d1d30fba9334f2fc |
|
MD5 | 5fe92baa24bee408e89fad9789932095 |
|
BLAKE2b-256 | 187a3430e5cf3501933db441aa27ba9bf2ae5039c5a685708a9ea03827398643 |