fastapi-plugin-notification 0.1.0__tar.gz → 0.2.1__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.
- fastapi_plugin_notification-0.2.1/PKG-INFO +93 -0
- fastapi_plugin_notification-0.2.1/README.md +75 -0
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/fastapi_plugin_notification/__init__.py +4 -1
- fastapi_plugin_notification-0.2.1/fastapi_plugin_notification/client.py +601 -0
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/fastapi_plugin_notification/models.py +5 -0
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/fastapi_plugin_notification/schemas.py +12 -0
- fastapi_plugin_notification-0.2.1/fastapi_plugin_notification/types.py +10 -0
- fastapi_plugin_notification-0.2.1/fastapi_plugin_notification.egg-info/PKG-INFO +93 -0
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/fastapi_plugin_notification.egg-info/SOURCES.txt +1 -0
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/pyproject.toml +1 -1
- fastapi_plugin_notification-0.2.1/tests/test_client.py +926 -0
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/tests/test_models.py +1 -0
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/tests/test_schemas.py +21 -0
- fastapi_plugin_notification-0.1.0/PKG-INFO +0 -375
- fastapi_plugin_notification-0.1.0/README.md +0 -357
- fastapi_plugin_notification-0.1.0/fastapi_plugin_notification/client.py +0 -206
- fastapi_plugin_notification-0.1.0/fastapi_plugin_notification.egg-info/PKG-INFO +0 -375
- fastapi_plugin_notification-0.1.0/tests/test_client.py +0 -347
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/LICENSE +0 -0
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/fastapi_plugin_notification/app.py +0 -0
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/fastapi_plugin_notification/controller.py +0 -0
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/fastapi_plugin_notification.egg-info/dependency_links.txt +0 -0
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/fastapi_plugin_notification.egg-info/requires.txt +0 -0
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/fastapi_plugin_notification.egg-info/top_level.txt +0 -0
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/setup.cfg +0 -0
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/tests/test_app.py +0 -0
- {fastapi_plugin_notification-0.1.0 → fastapi_plugin_notification-0.2.1}/tests/test_controller.py +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fastapi-plugin-notification
|
|
3
|
+
Version: 0.2.1
|
|
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
|
+
- 🧹 **Retention**: Configurable cleanup of notifications past their retention window
|
|
34
|
+
- 🚀 **FastAPI Integration**: Full CRUD API endpoints with authentication
|
|
35
|
+
- 📦 **PyPI Package**: Easy to install and use in any FastAPI project
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
Using UV:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
uv add fastapi-plugin-notification
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Or using pip:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install fastapi-plugin-notification
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## At a Glance
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from fastapi_provider_postmark import PostmarkProvider
|
|
55
|
+
from fastapi_plugin_notification import NotificationClient
|
|
56
|
+
|
|
57
|
+
notification_client = NotificationClient(
|
|
58
|
+
postmark_provider=PostmarkProvider(...),
|
|
59
|
+
default_template_id=123456,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
notification = await notification_client.send_notification(
|
|
63
|
+
db_engine=db,
|
|
64
|
+
name="welcome",
|
|
65
|
+
user_id="user_123",
|
|
66
|
+
user_email="user@example.com",
|
|
67
|
+
claims=request.state.claims,
|
|
68
|
+
link="https://example.com/dashboard",
|
|
69
|
+
link_name="Go to Dashboard",
|
|
70
|
+
)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Full setup — client, router and dependencies — is in the [Quick Start](docs/quickstart.md).
|
|
74
|
+
|
|
75
|
+
## Documentation
|
|
76
|
+
|
|
77
|
+
| Guide | Contents |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| [Quick Start](docs/quickstart.md) | Initialize the client, mount the router, send your first notification |
|
|
80
|
+
| [Usage Examples](docs/usage.md) | Storing, sending, listing and acknowledging notifications |
|
|
81
|
+
| [Notification Digests](docs/digests.md) | Daily/weekly digests, category grouping, example payload, Postmark Mustachio templates |
|
|
82
|
+
| [Cleaning Up Old Notifications](docs/cleanup.md) | Retention window and permanently removing stale notifications |
|
|
83
|
+
| [API Endpoints](docs/api-endpoints.md) | HTTP routes with request parameters and response bodies |
|
|
84
|
+
| [Model Structure](docs/model.md) | Fields on `NotificationModel` |
|
|
85
|
+
| [Ownership and Permissions](docs/ownership.md) | Claim-based ownership and required permissions |
|
|
86
|
+
| [Configuration](docs/configuration.md) | Router options, template variables, error handling |
|
|
87
|
+
| [Development](docs/development.md) | Local setup and running the tests |
|
|
88
|
+
|
|
89
|
+
Release history is in the [Changelog](CHANGELOG.md).
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT License - see LICENSE file for details
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
- 🧹 **Retention**: Configurable cleanup of notifications past their retention window
|
|
16
|
+
- 🚀 **FastAPI Integration**: Full CRUD API endpoints with authentication
|
|
17
|
+
- 📦 **PyPI Package**: Easy to install and use in any FastAPI project
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
Using UV:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
uv add fastapi-plugin-notification
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or using pip:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install fastapi-plugin-notification
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## At a Glance
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from fastapi_provider_postmark import PostmarkProvider
|
|
37
|
+
from fastapi_plugin_notification import NotificationClient
|
|
38
|
+
|
|
39
|
+
notification_client = NotificationClient(
|
|
40
|
+
postmark_provider=PostmarkProvider(...),
|
|
41
|
+
default_template_id=123456,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
notification = await notification_client.send_notification(
|
|
45
|
+
db_engine=db,
|
|
46
|
+
name="welcome",
|
|
47
|
+
user_id="user_123",
|
|
48
|
+
user_email="user@example.com",
|
|
49
|
+
claims=request.state.claims,
|
|
50
|
+
link="https://example.com/dashboard",
|
|
51
|
+
link_name="Go to Dashboard",
|
|
52
|
+
)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Full setup — client, router and dependencies — is in the [Quick Start](docs/quickstart.md).
|
|
56
|
+
|
|
57
|
+
## Documentation
|
|
58
|
+
|
|
59
|
+
| Guide | Contents |
|
|
60
|
+
| --- | --- |
|
|
61
|
+
| [Quick Start](docs/quickstart.md) | Initialize the client, mount the router, send your first notification |
|
|
62
|
+
| [Usage Examples](docs/usage.md) | Storing, sending, listing and acknowledging notifications |
|
|
63
|
+
| [Notification Digests](docs/digests.md) | Daily/weekly digests, category grouping, example payload, Postmark Mustachio templates |
|
|
64
|
+
| [Cleaning Up Old Notifications](docs/cleanup.md) | Retention window and permanently removing stale notifications |
|
|
65
|
+
| [API Endpoints](docs/api-endpoints.md) | HTTP routes with request parameters and response bodies |
|
|
66
|
+
| [Model Structure](docs/model.md) | Fields on `NotificationModel` |
|
|
67
|
+
| [Ownership and Permissions](docs/ownership.md) | Claim-based ownership and required permissions |
|
|
68
|
+
| [Configuration](docs/configuration.md) | Router options, template variables, error handling |
|
|
69
|
+
| [Development](docs/development.md) | Local setup and running the tests |
|
|
70
|
+
|
|
71
|
+
Release history is in the [Changelog](CHANGELOG.md).
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
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,7 +25,8 @@ __all__ = [
|
|
|
23
25
|
"NotificationUpdate",
|
|
24
26
|
"NotificationResponse",
|
|
25
27
|
"NotificationResponsePaginated",
|
|
28
|
+
"DigestPeriod",
|
|
26
29
|
"create_notification_router",
|
|
27
30
|
]
|
|
28
31
|
|
|
29
|
-
__version__ = "0.1
|
|
32
|
+
__version__ = "0.2.1"
|