fastapi-plugin-notification 0.1.0__tar.gz → 0.2.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.
Files changed (27) hide show
  1. fastapi_plugin_notification-0.2.0/PKG-INFO +89 -0
  2. fastapi_plugin_notification-0.2.0/README.md +71 -0
  3. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/fastapi_plugin_notification/__init__.py +3 -0
  4. fastapi_plugin_notification-0.2.0/fastapi_plugin_notification/client.py +545 -0
  5. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/fastapi_plugin_notification/models.py +5 -0
  6. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/fastapi_plugin_notification/schemas.py +12 -0
  7. fastapi_plugin_notification-0.2.0/fastapi_plugin_notification/types.py +10 -0
  8. fastapi_plugin_notification-0.2.0/fastapi_plugin_notification.egg-info/PKG-INFO +89 -0
  9. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/fastapi_plugin_notification.egg-info/SOURCES.txt +1 -0
  10. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/pyproject.toml +1 -1
  11. fastapi_plugin_notification-0.2.0/tests/test_client.py +724 -0
  12. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/tests/test_models.py +1 -0
  13. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/tests/test_schemas.py +21 -0
  14. fastapi_plugin_notification-0.1.0/PKG-INFO +0 -375
  15. fastapi_plugin_notification-0.1.0/README.md +0 -357
  16. fastapi_plugin_notification-0.1.0/fastapi_plugin_notification/client.py +0 -206
  17. fastapi_plugin_notification-0.1.0/fastapi_plugin_notification.egg-info/PKG-INFO +0 -375
  18. fastapi_plugin_notification-0.1.0/tests/test_client.py +0 -347
  19. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/LICENSE +0 -0
  20. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/fastapi_plugin_notification/app.py +0 -0
  21. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/fastapi_plugin_notification/controller.py +0 -0
  22. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/fastapi_plugin_notification.egg-info/dependency_links.txt +0 -0
  23. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/fastapi_plugin_notification.egg-info/requires.txt +0 -0
  24. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/fastapi_plugin_notification.egg-info/top_level.txt +0 -0
  25. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/setup.cfg +0 -0
  26. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/tests/test_app.py +0 -0
  27. {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.0}/tests/test_controller.py +0 -0
@@ -0,0 +1,89 @@
1
+ Metadata-Version: 2.4
2
+ Name: fastapi-plugin-notification
3
+ Version: 0.2.0
4
+ Summary: Notification plugin for FastAPI projects using FastAPI SDK and Postmark provider.
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: fastapi-sdk>=0.9.7
9
+ Requires-Dist: fastapi-provider-postmark>=0.1.1
10
+ Requires-Dist: fastapi>=0.115.11
11
+ Requires-Dist: odmantic>=1.0.2
12
+ Requires-Dist: pydantic>=2.10.6
13
+ Provides-Extra: dev
14
+ Requires-Dist: pytest>=9.0.1; extra == "dev"
15
+ Requires-Dist: pytest-asyncio>=0.25.3; extra == "dev"
16
+ Requires-Dist: motor>=3.6.0; extra == "dev"
17
+ Dynamic: license-file
18
+
19
+ # FastAPI Plugin Notification
20
+
21
+ A notification plugin for FastAPI that integrates with FastAPI SDK and Postmark provider to send notifications via email and store them in a database.
22
+
23
+ ## Features
24
+
25
+ - 📧 **Email Notifications**: Send notifications via Postmark email provider
26
+ - 💾 **Database Storage**: Store notifications in MongoDB using ODMantic
27
+ - 🔐 **User Ownership**: Automatic ownership filtering based on user claims
28
+ - 📊 **Notification Management**:
29
+ - Get all notifications for a user
30
+ - Mark notifications as seen/acknowledged
31
+ - Get unseen notification count
32
+ - 🗞️ **Digests**: Daily or weekly digest emails, grouped by category
33
+ - 🚀 **FastAPI Integration**: Full CRUD API endpoints with authentication
34
+ - 📦 **PyPI Package**: Easy to install and use in any FastAPI project
35
+
36
+ ## Installation
37
+
38
+ Using UV:
39
+
40
+ ```bash
41
+ uv add fastapi-plugin-notification
42
+ ```
43
+
44
+ Or using pip:
45
+
46
+ ```bash
47
+ pip install fastapi-plugin-notification
48
+ ```
49
+
50
+ ## At a Glance
51
+
52
+ ```python
53
+ from fastapi_provider_postmark import PostmarkProvider
54
+ from fastapi_plugin_notification import NotificationClient
55
+
56
+ notification_client = NotificationClient(
57
+ postmark_provider=PostmarkProvider(...),
58
+ default_template_id=123456,
59
+ )
60
+
61
+ notification = await notification_client.send_notification(
62
+ db_engine=db,
63
+ name="welcome",
64
+ user_id="user_123",
65
+ user_email="user@example.com",
66
+ claims=request.state.claims,
67
+ link="https://example.com/dashboard",
68
+ link_name="Go to Dashboard",
69
+ )
70
+ ```
71
+
72
+ Full setup — client, router and dependencies — is in the [Quick Start](docs/quickstart.md).
73
+
74
+ ## Documentation
75
+
76
+ | Guide | Contents |
77
+ | --- | --- |
78
+ | [Quick Start](docs/quickstart.md) | Initialize the client, mount the router, send your first notification |
79
+ | [Usage Examples](docs/usage.md) | Storing, sending, listing and acknowledging notifications |
80
+ | [Notification Digests](docs/digests.md) | Daily/weekly digests, category grouping, example payload, Postmark Mustachio templates |
81
+ | [API Endpoints](docs/api-endpoints.md) | HTTP routes with request parameters and response bodies |
82
+ | [Model Structure](docs/model.md) | Fields on `NotificationModel` |
83
+ | [Ownership and Permissions](docs/ownership.md) | Claim-based ownership and required permissions |
84
+ | [Configuration](docs/configuration.md) | Router options, template variables, error handling |
85
+ | [Development](docs/development.md) | Local setup and running the tests |
86
+
87
+ ## License
88
+
89
+ MIT License - see LICENSE file for details
@@ -0,0 +1,71 @@
1
+ # FastAPI Plugin Notification
2
+
3
+ A notification plugin for FastAPI that integrates with FastAPI SDK and Postmark provider to send notifications via email and store them in a database.
4
+
5
+ ## Features
6
+
7
+ - 📧 **Email Notifications**: Send notifications via Postmark email provider
8
+ - 💾 **Database Storage**: Store notifications in MongoDB using ODMantic
9
+ - 🔐 **User Ownership**: Automatic ownership filtering based on user claims
10
+ - 📊 **Notification Management**:
11
+ - Get all notifications for a user
12
+ - Mark notifications as seen/acknowledged
13
+ - Get unseen notification count
14
+ - 🗞️ **Digests**: Daily or weekly digest emails, grouped by category
15
+ - 🚀 **FastAPI Integration**: Full CRUD API endpoints with authentication
16
+ - 📦 **PyPI Package**: Easy to install and use in any FastAPI project
17
+
18
+ ## Installation
19
+
20
+ Using UV:
21
+
22
+ ```bash
23
+ uv add fastapi-plugin-notification
24
+ ```
25
+
26
+ Or using pip:
27
+
28
+ ```bash
29
+ pip install fastapi-plugin-notification
30
+ ```
31
+
32
+ ## At a Glance
33
+
34
+ ```python
35
+ from fastapi_provider_postmark import PostmarkProvider
36
+ from fastapi_plugin_notification import NotificationClient
37
+
38
+ notification_client = NotificationClient(
39
+ postmark_provider=PostmarkProvider(...),
40
+ default_template_id=123456,
41
+ )
42
+
43
+ notification = await notification_client.send_notification(
44
+ db_engine=db,
45
+ name="welcome",
46
+ user_id="user_123",
47
+ user_email="user@example.com",
48
+ claims=request.state.claims,
49
+ link="https://example.com/dashboard",
50
+ link_name="Go to Dashboard",
51
+ )
52
+ ```
53
+
54
+ Full setup — client, router and dependencies — is in the [Quick Start](docs/quickstart.md).
55
+
56
+ ## Documentation
57
+
58
+ | Guide | Contents |
59
+ | --- | --- |
60
+ | [Quick Start](docs/quickstart.md) | Initialize the client, mount the router, send your first notification |
61
+ | [Usage Examples](docs/usage.md) | Storing, sending, listing and acknowledging notifications |
62
+ | [Notification Digests](docs/digests.md) | Daily/weekly digests, category grouping, example payload, Postmark Mustachio templates |
63
+ | [API Endpoints](docs/api-endpoints.md) | HTTP routes with request parameters and response bodies |
64
+ | [Model Structure](docs/model.md) | Fields on `NotificationModel` |
65
+ | [Ownership and Permissions](docs/ownership.md) | Claim-based ownership and required permissions |
66
+ | [Configuration](docs/configuration.md) | Router options, template variables, error handling |
67
+ | [Development](docs/development.md) | Local setup and running the tests |
68
+
69
+ ## License
70
+
71
+ MIT License - see LICENSE file for details
@@ -15,6 +15,8 @@ from fastapi_plugin_notification.schemas import (
15
15
  NotificationUpdate,
16
16
  )
17
17
 
18
+ from fastapi_plugin_notification.types import DigestPeriod
19
+
18
20
  __all__ = [
19
21
  "NotificationClient",
20
22
  "NotificationController",
@@ -23,6 +25,7 @@ __all__ = [
23
25
  "NotificationUpdate",
24
26
  "NotificationResponse",
25
27
  "NotificationResponsePaginated",
28
+ "DigestPeriod",
26
29
  "create_notification_router",
27
30
  ]
28
31