goatnotify-celery 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Louis Midson LAJEANTY <midsonlajeanty@proton.me>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,36 @@
1
+ Metadata-Version: 2.4
2
+ Name: goatnotify-celery
3
+ Version: 0.3.0
4
+ Summary: Celery queue for GoatNotify, with delivery receipts that make retries idempotent.
5
+ Keywords: notifications,email,celery,queue,asyncio,typed
6
+ Author: Louis Midson LAJEANTY
7
+ Author-email: Louis Midson LAJEANTY <midsonlajeanty@proton.me>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Framework :: Celery
12
+ Classifier: Framework :: Django
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Typing :: Typed
17
+ Requires-Dist: goatnotify-core==0.3.0
18
+ Requires-Dist: goatnotify-django==0.3.0
19
+ Requires-Dist: celery>=5.5
20
+ Requires-Dist: django>=6.1
21
+ Requires-Python: >=3.14
22
+ Project-URL: Homepage, https://github.com/goatlabshq/goatnotify
23
+ Project-URL: Documentation, https://goatlabshq.github.io/goatnotify/
24
+ Project-URL: Issues, https://github.com/goatlabshq/goatnotify/issues
25
+ Description-Content-Type: text/markdown
26
+
27
+ # goatnotify-celery
28
+
29
+ Celery queue for GoatNotify in Django projects. Delivery receipts make retries and redeliveries
30
+ idempotent: a message already sent is never sent again.
31
+
32
+ ```bash
33
+ pip install goatnotify-celery
34
+ ```
35
+
36
+ Documentation: <https://goatlabshq.github.io/goatnotify/queues/#celery>
@@ -0,0 +1,10 @@
1
+ # goatnotify-celery
2
+
3
+ Celery queue for GoatNotify in Django projects. Delivery receipts make retries and redeliveries
4
+ idempotent: a message already sent is never sent again.
5
+
6
+ ```bash
7
+ pip install goatnotify-celery
8
+ ```
9
+
10
+ Documentation: <https://goatlabshq.github.io/goatnotify/queues/#celery>
@@ -0,0 +1,53 @@
1
+ [project]
2
+ name = "goatnotify-celery"
3
+ version = "0.3.0"
4
+ description = "Celery queue for GoatNotify, with delivery receipts that make retries idempotent."
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ requires-python = ">=3.14"
9
+ keywords = [
10
+ "notifications",
11
+ "email",
12
+ "celery",
13
+ "queue",
14
+ "asyncio",
15
+ "typed",
16
+ ]
17
+ classifiers = [
18
+ "Development Status :: 3 - Alpha",
19
+ "Framework :: Celery",
20
+ "Framework :: Django",
21
+ "Intended Audience :: Developers",
22
+ "Programming Language :: Python :: 3",
23
+ "Programming Language :: Python :: 3.14",
24
+ "Typing :: Typed",
25
+ ]
26
+ dependencies = [
27
+ "goatnotify-core==0.3.0",
28
+ "goatnotify-django==0.3.0",
29
+ "celery>=5.5",
30
+ "django>=6.1",
31
+ ]
32
+
33
+ [[project.authors]]
34
+ name = "Louis Midson LAJEANTY"
35
+ email = "midsonlajeanty@proton.me"
36
+
37
+ [project.urls]
38
+ Homepage = "https://github.com/goatlabshq/goatnotify"
39
+ Documentation = "https://goatlabshq.github.io/goatnotify/"
40
+ Issues = "https://github.com/goatlabshq/goatnotify/issues"
41
+
42
+ [build-system]
43
+ requires = ["uv_build>=0.12,<0.14"]
44
+ build-backend = "uv_build"
45
+
46
+ [tool.uv.build-backend]
47
+ module-name = "goatnotify.celery"
48
+
49
+ [tool.uv.sources.goatnotify-core]
50
+ workspace = true
51
+
52
+ [tool.uv.sources.goatnotify-django]
53
+ workspace = true
@@ -0,0 +1,41 @@
1
+ [project]
2
+ name = "goatnotify-celery"
3
+ version = "0.3.0" # x-release-please-version
4
+ description = "Celery queue for GoatNotify, with delivery receipts that make retries idempotent."
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ authors = [{ name = "Louis Midson LAJEANTY", email = "midsonlajeanty@proton.me" }]
9
+ requires-python = ">=3.14"
10
+ keywords = ["notifications", "email", "celery", "queue", "asyncio", "typed"]
11
+ classifiers = [
12
+ "Development Status :: 3 - Alpha",
13
+ "Framework :: Celery",
14
+ "Framework :: Django",
15
+ "Intended Audience :: Developers",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.14",
18
+ "Typing :: Typed",
19
+ ]
20
+ dependencies = [
21
+ "goatnotify-core==0.3.0", # x-release-please-version
22
+ "goatnotify-django==0.3.0", # x-release-please-version
23
+ "celery>=5.5",
24
+ "django>=6.1",
25
+ ]
26
+
27
+ [project.urls]
28
+ Homepage = "https://github.com/goatlabshq/goatnotify"
29
+ Documentation = "https://goatlabshq.github.io/goatnotify/"
30
+ Issues = "https://github.com/goatlabshq/goatnotify/issues"
31
+
32
+ [build-system]
33
+ requires = ["uv_build>=0.12,<0.14"]
34
+ build-backend = "uv_build"
35
+
36
+ [tool.uv.build-backend]
37
+ module-name = "goatnotify.celery"
38
+
39
+ [tool.uv.sources]
40
+ goatnotify-core = { workspace = true }
41
+ goatnotify-django = { workspace = true }
@@ -0,0 +1,3 @@
1
+ from goatnotify.celery.queue import CeleryQueue
2
+
3
+ __all__ = ["CeleryQueue"]
@@ -0,0 +1,7 @@
1
+ from django.apps import AppConfig
2
+
3
+
4
+ class GoatNotifyCeleryConfig(AppConfig):
5
+ name = "goatnotify.celery"
6
+ label = "goatnotify_celery"
7
+ verbose_name = "GoatNotify Celery"
File without changes
@@ -0,0 +1,31 @@
1
+ import asyncio
2
+ from typing import Final
3
+ from uuid import uuid4
4
+
5
+ from celery import Celery
6
+ from goatnotify.core.notification import Notifiable
7
+ from goatnotify.core.queue import NotificationJob
8
+ from goatnotify.django.serialization import dump_job
9
+
10
+ TASK_NAME: Final = "goatnotify.deliver"
11
+
12
+
13
+ class CeleryQueue:
14
+ def __init__(
15
+ self, app: Celery, *, queue: str | None = None, priority: int | None = None
16
+ ) -> None:
17
+ self._app = app
18
+ self._queue = queue
19
+ self._priority = priority
20
+
21
+ async def enqueue[R: Notifiable](self, job: NotificationJob[R]) -> None:
22
+ notifiable, notification = dump_job(job, queue=type(self).__name__)
23
+ job_id = str(uuid4())
24
+ await asyncio.to_thread(
25
+ self._app.send_task,
26
+ TASK_NAME,
27
+ args=[notifiable, notification, job_id],
28
+ task_id=job_id,
29
+ queue=self._queue,
30
+ priority=self._priority,
31
+ )
@@ -0,0 +1,10 @@
1
+ from celery import shared_task
2
+ from goatnotify.celery.queue import TASK_NAME
3
+ from goatnotify.django.delivery import deliver_sync
4
+ from goatnotify.django.serialization import Payload
5
+
6
+
7
+ # Late acknowledgement redelivers a job whose worker died; the receipts make that harmless.
8
+ @shared_task(name=TASK_NAME, acks_late=True, reject_on_worker_lost=True)
9
+ def deliver_notification(notifiable: Payload, notification: Payload, job_id: str) -> None:
10
+ deliver_sync(notifiable, notification, job_id)