desktop-notifier 5.0.0.dev2__tar.gz → 6.0.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 (28) hide show
  1. {desktop_notifier-5.0.0.dev2/src/desktop_notifier.egg-info → desktop_notifier-6.0.0}/PKG-INFO +86 -86
  2. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0}/README.md +67 -78
  3. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0}/pyproject.toml +28 -8
  4. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0}/src/desktop_notifier/__init__.py +8 -8
  5. desktop_notifier-6.0.0/src/desktop_notifier/backends/base.py +187 -0
  6. {desktop_notifier-5.0.0.dev2/src/desktop_notifier → desktop_notifier-6.0.0/src/desktop_notifier/backends}/dbus.py +67 -93
  7. {desktop_notifier-5.0.0.dev2/src/desktop_notifier → desktop_notifier-6.0.0/src/desktop_notifier/backends}/dummy.py +8 -19
  8. {desktop_notifier-5.0.0.dev2/src/desktop_notifier → desktop_notifier-6.0.0/src/desktop_notifier/backends}/macos.py +64 -82
  9. {desktop_notifier-5.0.0.dev2/src/desktop_notifier → desktop_notifier-6.0.0/src/desktop_notifier/backends}/macos_support.py +26 -11
  10. {desktop_notifier-5.0.0.dev2/src/desktop_notifier → desktop_notifier-6.0.0/src/desktop_notifier/backends}/winrt.py +92 -116
  11. desktop_notifier-6.0.0/src/desktop_notifier/common.py +313 -0
  12. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0}/src/desktop_notifier/main.py +127 -80
  13. desktop_notifier-6.0.0/src/desktop_notifier/py.typed +0 -0
  14. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0}/src/desktop_notifier/sync.py +20 -23
  15. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0/src/desktop_notifier.egg-info}/PKG-INFO +86 -86
  16. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0}/src/desktop_notifier.egg-info/SOURCES.txt +9 -6
  17. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0}/src/desktop_notifier.egg-info/requires.txt +7 -5
  18. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0}/tests/test_api.py +30 -27
  19. desktop_notifier-6.0.0/tests/test_callbacks.py +186 -0
  20. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0}/tests/test_sync_api.py +12 -9
  21. desktop_notifier-5.0.0.dev2/src/desktop_notifier/base.py +0 -543
  22. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0}/LICENSE +0 -0
  23. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0}/setup.cfg +0 -0
  24. /desktop_notifier-5.0.0.dev2/src/desktop_notifier/py.typed → /desktop_notifier-6.0.0/src/desktop_notifier/backends/__init__.py +0 -0
  25. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0}/src/desktop_notifier/resources/__init__.py +0 -0
  26. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0}/src/desktop_notifier/resources/python.png +0 -0
  27. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0}/src/desktop_notifier.egg-info/dependency_links.txt +0 -0
  28. {desktop_notifier-5.0.0.dev2 → desktop_notifier-6.0.0}/src/desktop_notifier.egg-info/top_level.txt +0 -0
@@ -1,27 +1,37 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: desktop-notifier
3
- Version: 5.0.0.dev2
3
+ Version: 6.0.0
4
4
  Summary: Python library for cross-platform desktop notifications
5
5
  Author-email: Sam Schott <sam.schott@outlook.com>
6
6
  License: MIT
7
7
  Project-URL: Homepage, https://github.com/samschott/desktop-notifier
8
- Keywords: desktop-notifier
9
- Classifier: Development Status :: 2 - Pre-Alpha
8
+ Keywords: desktop-notifier,notifications,Notification Center,push notifications,Toast notifications
9
+ Classifier: Development Status :: 5 - Production/Stable
10
10
  Classifier: Intended Audience :: Developers
11
11
  Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Natural Language :: English
13
+ Classifier: Operating System :: MacOS :: MacOS X
14
+ Classifier: Operating System :: Microsoft :: Windows
15
+ Classifier: Operating System :: OS Independent
13
16
  Classifier: Programming Language :: Python :: 3
14
17
  Classifier: Programming Language :: Python :: 3.7
15
18
  Classifier: Programming Language :: Python :: 3.8
16
19
  Classifier: Programming Language :: Python :: 3.9
17
20
  Classifier: Programming Language :: Python :: 3.10
18
21
  Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
19
23
  Classifier: Programming Language :: Python :: 3 :: Only
24
+ Classifier: Topic :: Communications
25
+ Classifier: Topic :: Desktop Environment
26
+ Classifier: Topic :: Desktop Environment :: Gnome
27
+ Classifier: Topic :: Desktop Environment :: K Desktop Environment (KDE)
28
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
29
  Requires-Python: >=3.7
21
30
  Description-Content-Type: text/markdown
22
31
  License-File: LICENSE
32
+ Requires-Dist: bidict
23
33
  Requires-Dist: packaging
24
- Requires-Dist: dbus-next; sys_platform == "linux"
34
+ Requires-Dist: dbus-fast; sys_platform == "linux"
25
35
  Requires-Dist: rubicon-objc; sys_platform == "darwin"
26
36
  Requires-Dist: winrt-windows.applicationmodel.core; sys_platform == "win32"
27
37
  Requires-Dist: winrt-windows.data.xml.dom; sys_platform == "win32"
@@ -34,40 +44,33 @@ Requires-Dist: black; extra == "dev"
34
44
  Requires-Dist: bump2version; extra == "dev"
35
45
  Requires-Dist: flake8; extra == "dev"
36
46
  Requires-Dist: flake8-pyproject; extra == "dev"
47
+ Requires-Dist: isort; extra == "dev"
37
48
  Requires-Dist: mypy; extra == "dev"
38
49
  Requires-Dist: pytest; extra == "dev"
39
50
  Requires-Dist: pytest-asyncio; extra == "dev"
40
51
  Requires-Dist: pytest-cov; extra == "dev"
41
52
  Provides-Extra: docs
42
- Requires-Dist: furo==2024.5.6; extra == "docs"
43
- Requires-Dist: sphinx==7.3.7; extra == "docs"
44
- Requires-Dist: sphinx-autoapi==3.1.2; extra == "docs"
45
- Requires-Dist: sphinx-mdinclude==0.6.1; extra == "docs"
53
+ Requires-Dist: furo==2024.8.6; extra == "docs"
54
+ Requires-Dist: sphinx==8.0.2; extra == "docs"
55
+ Requires-Dist: sphinx-autoapi==3.3.1; extra == "docs"
56
+ Requires-Dist: sphinx-mdinclude==0.6.2; extra == "docs"
57
+
58
+
59
+ # Desktop Notifier
46
60
 
47
61
  [![PyPi Release](https://img.shields.io/pypi/v/desktop-notifier.svg)](https://pypi.org/project/desktop-notifier/)
48
62
  [![Pyversions](https://img.shields.io/pypi/pyversions/desktop-notifier.svg)](https://pypi.org/pypi/desktop-notifier/)
49
63
  [![Documentation Status](https://readthedocs.org/projects/desktop-notifier/badge/?version=latest)](https://desktop-notifier.readthedocs.io/en/latest/?badge=latest)
50
64
 
51
- # Desktop Notifier
52
-
53
65
  `desktop-notifier` is a Python library for cross-platform desktop notifications.
54
66
  Currently supported platforms are:
55
67
 
56
68
  * Linux via the dbus service org.freedesktop.Notifications
57
69
  * macOS and iOS via the Notification Center framework
58
- * [**experimental**] Windows via the WinRT / Python bridge.
59
-
60
- ![gif](screenshots/macOS.gif)
70
+ * Windows via the WinRT / Python bridge
61
71
 
62
72
  ## Features
63
73
 
64
- `desktop-notifier` aims to be a good citizen of the platforms which it supports. It
65
- therefore stays within the limits of the native platform APIs and does not try to work
66
- around limitations which are often deliberate UI choices. For example, on macOS and
67
- iOS, it is not possible to change the app icon which is shown on notifications. There
68
- are possible workarounds - that would likely be rejected by an App Store review - and
69
- desktop-notifier deliberately stays away from those.
70
-
71
74
  Where supported by the native platform APIs, `desktop-notifier` allows for:
72
75
 
73
76
  * Clickable notifications with callbacks on user interaction
@@ -77,16 +80,17 @@ Where supported by the native platform APIs, `desktop-notifier` allows for:
77
80
  * Notification threads (grouping notifications by topic)
78
81
  * Limiting the maximum number of notifications shown in the notification center
79
82
 
83
+ An example of how some of this looks like on macOS:
84
+
85
+ ![gif](https://github.com/samschott/desktop-notifier/blob/main/screenshots/macOS.gif?raw=true)
86
+
80
87
  An exhaustive list of features and their platform support is provided in the
81
88
  [documentation](https://desktop-notifier.readthedocs.io/en/latest/background/platform_support.html).
89
+ In addition, you can query supported features at runtime with
90
+ `DesktopNotifier.get_capabilities()`.
82
91
 
83
- Design choices by `desktop-notifier`:
84
-
85
- * Async API: The main API consists of async methods and a running event loop
86
- is required to respond to user interactions with a notification.
87
- * Prefer pure Python dependencies over extension modules. We make an exception for
88
- Windows because interoperability with the Windows Runtime is difficult to achieve
89
- otherwise.
92
+ Any options or configurations which are not supported by the platform will be silently
93
+ ignored.
90
94
 
91
95
  ## Installation
92
96
 
@@ -108,71 +112,58 @@ from desktop_notifier import DesktopNotifier
108
112
  notifier = DesktopNotifier()
109
113
 
110
114
  async def main():
111
- n = await notifier.send(title="Hello world!", message="Sent from Python")
112
-
113
- await asyncio.sleep(5) # wait a bit before clearing notification
114
-
115
- await notifier.clear(n) # removes the notification
116
- await notifier.clear_all() # removes all notifications for this app
115
+ await notifier.send(title="Hello world!", message="Sent from Python")
117
116
 
118
117
  asyncio.run(main())
119
118
  ```
120
119
 
121
- For convenience, there is also a synchronous method ``send_sync()`` to send
122
- notifications without manually starting an asyncio event loop:
123
-
124
- ```Python
125
- notifier.send_sync(title="Hello world!", message="Sent from Python")
126
- ```
127
-
128
120
  By default, "Python" will be used as the app name for all notifications, but you can
129
121
  manually specify an app name and icon in the ``DesktopNotifier`` constructor. Advanced
130
122
  usage also allows setting different notification options such as urgency, buttons,
131
- callbacks, etc. The following code will generate the notification shown in the gif at
132
- the top of the page:
123
+ callbacks, etc. For example, for the gif displayed above:
133
124
 
134
125
  ```Python
135
126
  import asyncio
136
- from desktop_notifier import DesktopNotifier, Urgency, Button, ReplyField, DEFAULT_SOUND
127
+ import signal
137
128
 
138
- notifier = DesktopNotifier()
129
+ from desktop_notifier import DesktopNotifier, Urgency, Button, ReplyField, DEFAULT_SOUND
139
130
 
140
- async def main():
141
- await notifier.send(
142
- title="Julius Caesar",
143
- message="Et tu, Brute?",
144
- urgency=Urgency.Critical,
145
- buttons=[
146
- Button(
147
- title="Mark as read",
148
- on_pressed=lambda: print("Marked as read")),
149
- ],
150
- reply_field=ReplyField(
151
- title="Reply",
152
- button_title="Send",
153
- on_replied=lambda text: print("Brutus replied:", text),
154
- ),
155
- on_clicked=lambda: print("Notification clicked"),
156
- on_dismissed=lambda: print("Notification dismissed"),
157
- sound_file=DEFAULT_SOUND,
158
- )
159
-
160
-
161
- loop = asyncio.get_event_loop()
162
- loop.create_task(main())
163
- loop.run_forever()
164
- ```
165
131
 
166
- Note that some platforms may not support all options. For instance, some Linux desktop
167
- environments may not support notifications with buttons. macOS does not support manually
168
- setting the app icon or name. Instead, both are always determined by the application
169
- which uses the Library. This can be Python itself, or a frozen app bundle when packaged
170
- with PyInstaller or similar solutions. Please refer to the
171
- [Platform Support](https://desktop-notifier.readthedocs.io/en/latest/background/platform_support.html)
172
- chapter of the documentation for more information on limitations for certain platforms.
132
+ async def main() -> None:
133
+ notifier = DesktopNotifier(
134
+ app_name="Sample App",
135
+ notification_limit=10,
136
+ )
137
+
138
+ await notifier.send(
139
+ title="Julius Caesar",
140
+ message="Et tu, Brute?",
141
+ urgency=Urgency.Critical,
142
+ buttons=[
143
+ Button(
144
+ title="Mark as read",
145
+ on_pressed=lambda: print("Marked as read"),
146
+ )
147
+ ],
148
+ reply_field=ReplyField(
149
+ on_replied=lambda text: print("Brutus replied:", text),
150
+ ),
151
+ on_clicked=lambda: print("Notification clicked"),
152
+ on_dismissed=lambda: print("Notification dismissed"),
153
+ sound=DEFAULT_SOUND,
154
+ )
155
+
156
+ # Run the event loop forever to respond to user interactions with the notification.
157
+ stop_event = asyncio.Event()
158
+ loop = asyncio.get_running_loop()
159
+
160
+ loop.add_signal_handler(signal.SIGINT, stop_event.set)
161
+ loop.add_signal_handler(signal.SIGTERM, stop_event.set)
162
+
163
+ await stop_event.wait()
173
164
 
174
- Any options or configurations which are not supported by the platform will be silently
175
- ignored.
165
+ asyncio.run(main())
166
+ ```
176
167
 
177
168
  ## Event loop integration
178
169
 
@@ -190,10 +181,6 @@ from rubicon.objc.eventloop import EventLoopPolicy
190
181
 
191
182
  # Install the event loop policy
192
183
  asyncio.set_event_loop_policy(EventLoopPolicy())
193
-
194
- # Get an event loop, and run it!
195
- loop = asyncio.get_event_loop()
196
- loop.run_forever()
197
184
  ```
198
185
 
199
186
  Desktop-notifier itself uses Rubicon Objective-C to interface with Cocoa APIs. A full
@@ -221,13 +208,26 @@ the resulting app bundle for notifications to work. An ad-hoc signature will be
221
208
  sufficient but signing with an Apple developer certificate is recommended for
222
209
  distribution and may be required on future releases of macOS.
223
210
 
224
- ## Requirements
211
+ ## Design choices
212
+
213
+ This package is opinionated in a few ways:
225
214
 
226
- * macOS 10.13 or higher
227
- * Linux desktop environment providing a dbus desktop notifications service
215
+ * It does not try to work around platform restrictions, such as changing the app icon on
216
+ macOS. Workarounds would be hacky and likely be rejected by an App Store review.
217
+ * The main API consists of async methods and a running event loop is required to respond
218
+ to user interactions with a notification. This simplifies integration with GUI apps.
219
+ * Dependencies are pure Python packages without extension modules. This simplifies app
220
+ bundling and distribution. We make an exception for Windows because interoperability
221
+ with the Windows Runtime is difficult to achieve without extension modules.
222
+ * If a certain feature is not supported by a platform, using it will not raise an
223
+ exception. This allows clients to use a wide feature set where available without
224
+ worrying about exception handling.
225
+ * If a notification cannot be scheduled, this is logged as a warning and does not raise
226
+ an exception. Most platforms allow the user to control if and how notifications are
227
+ delivered and notification delivery therefore cannot be taken as guaranteed.
228
228
 
229
229
  ## Dependencies
230
230
 
231
231
  * [dbus-next](https://github.com/altdesktop/python-dbus-next) on Linux
232
232
  * [rubicon-objc](https://github.com/beeware/rubicon-objc) on macOS
233
- * [winsdk](https://github.com/pywinrt/python-winsdk) on Windows
233
+ * [pywinrt](https://github.com/pywinrt/pywinrt) on Windows
@@ -1,27 +1,19 @@
1
+
2
+ # Desktop Notifier
3
+
1
4
  [![PyPi Release](https://img.shields.io/pypi/v/desktop-notifier.svg)](https://pypi.org/project/desktop-notifier/)
2
5
  [![Pyversions](https://img.shields.io/pypi/pyversions/desktop-notifier.svg)](https://pypi.org/pypi/desktop-notifier/)
3
6
  [![Documentation Status](https://readthedocs.org/projects/desktop-notifier/badge/?version=latest)](https://desktop-notifier.readthedocs.io/en/latest/?badge=latest)
4
7
 
5
- # Desktop Notifier
6
-
7
8
  `desktop-notifier` is a Python library for cross-platform desktop notifications.
8
9
  Currently supported platforms are:
9
10
 
10
11
  * Linux via the dbus service org.freedesktop.Notifications
11
12
  * macOS and iOS via the Notification Center framework
12
- * [**experimental**] Windows via the WinRT / Python bridge.
13
-
14
- ![gif](screenshots/macOS.gif)
13
+ * Windows via the WinRT / Python bridge
15
14
 
16
15
  ## Features
17
16
 
18
- `desktop-notifier` aims to be a good citizen of the platforms which it supports. It
19
- therefore stays within the limits of the native platform APIs and does not try to work
20
- around limitations which are often deliberate UI choices. For example, on macOS and
21
- iOS, it is not possible to change the app icon which is shown on notifications. There
22
- are possible workarounds - that would likely be rejected by an App Store review - and
23
- desktop-notifier deliberately stays away from those.
24
-
25
17
  Where supported by the native platform APIs, `desktop-notifier` allows for:
26
18
 
27
19
  * Clickable notifications with callbacks on user interaction
@@ -31,16 +23,17 @@ Where supported by the native platform APIs, `desktop-notifier` allows for:
31
23
  * Notification threads (grouping notifications by topic)
32
24
  * Limiting the maximum number of notifications shown in the notification center
33
25
 
26
+ An example of how some of this looks like on macOS:
27
+
28
+ ![gif](https://github.com/samschott/desktop-notifier/blob/main/screenshots/macOS.gif?raw=true)
29
+
34
30
  An exhaustive list of features and their platform support is provided in the
35
31
  [documentation](https://desktop-notifier.readthedocs.io/en/latest/background/platform_support.html).
32
+ In addition, you can query supported features at runtime with
33
+ `DesktopNotifier.get_capabilities()`.
36
34
 
37
- Design choices by `desktop-notifier`:
38
-
39
- * Async API: The main API consists of async methods and a running event loop
40
- is required to respond to user interactions with a notification.
41
- * Prefer pure Python dependencies over extension modules. We make an exception for
42
- Windows because interoperability with the Windows Runtime is difficult to achieve
43
- otherwise.
35
+ Any options or configurations which are not supported by the platform will be silently
36
+ ignored.
44
37
 
45
38
  ## Installation
46
39
 
@@ -62,71 +55,58 @@ from desktop_notifier import DesktopNotifier
62
55
  notifier = DesktopNotifier()
63
56
 
64
57
  async def main():
65
- n = await notifier.send(title="Hello world!", message="Sent from Python")
66
-
67
- await asyncio.sleep(5) # wait a bit before clearing notification
68
-
69
- await notifier.clear(n) # removes the notification
70
- await notifier.clear_all() # removes all notifications for this app
58
+ await notifier.send(title="Hello world!", message="Sent from Python")
71
59
 
72
60
  asyncio.run(main())
73
61
  ```
74
62
 
75
- For convenience, there is also a synchronous method ``send_sync()`` to send
76
- notifications without manually starting an asyncio event loop:
77
-
78
- ```Python
79
- notifier.send_sync(title="Hello world!", message="Sent from Python")
80
- ```
81
-
82
63
  By default, "Python" will be used as the app name for all notifications, but you can
83
64
  manually specify an app name and icon in the ``DesktopNotifier`` constructor. Advanced
84
65
  usage also allows setting different notification options such as urgency, buttons,
85
- callbacks, etc. The following code will generate the notification shown in the gif at
86
- the top of the page:
66
+ callbacks, etc. For example, for the gif displayed above:
87
67
 
88
68
  ```Python
89
69
  import asyncio
90
- from desktop_notifier import DesktopNotifier, Urgency, Button, ReplyField, DEFAULT_SOUND
70
+ import signal
91
71
 
92
- notifier = DesktopNotifier()
72
+ from desktop_notifier import DesktopNotifier, Urgency, Button, ReplyField, DEFAULT_SOUND
93
73
 
94
- async def main():
95
- await notifier.send(
96
- title="Julius Caesar",
97
- message="Et tu, Brute?",
98
- urgency=Urgency.Critical,
99
- buttons=[
100
- Button(
101
- title="Mark as read",
102
- on_pressed=lambda: print("Marked as read")),
103
- ],
104
- reply_field=ReplyField(
105
- title="Reply",
106
- button_title="Send",
107
- on_replied=lambda text: print("Brutus replied:", text),
108
- ),
109
- on_clicked=lambda: print("Notification clicked"),
110
- on_dismissed=lambda: print("Notification dismissed"),
111
- sound_file=DEFAULT_SOUND,
112
- )
113
-
114
-
115
- loop = asyncio.get_event_loop()
116
- loop.create_task(main())
117
- loop.run_forever()
118
- ```
119
74
 
120
- Note that some platforms may not support all options. For instance, some Linux desktop
121
- environments may not support notifications with buttons. macOS does not support manually
122
- setting the app icon or name. Instead, both are always determined by the application
123
- which uses the Library. This can be Python itself, or a frozen app bundle when packaged
124
- with PyInstaller or similar solutions. Please refer to the
125
- [Platform Support](https://desktop-notifier.readthedocs.io/en/latest/background/platform_support.html)
126
- chapter of the documentation for more information on limitations for certain platforms.
75
+ async def main() -> None:
76
+ notifier = DesktopNotifier(
77
+ app_name="Sample App",
78
+ notification_limit=10,
79
+ )
80
+
81
+ await notifier.send(
82
+ title="Julius Caesar",
83
+ message="Et tu, Brute?",
84
+ urgency=Urgency.Critical,
85
+ buttons=[
86
+ Button(
87
+ title="Mark as read",
88
+ on_pressed=lambda: print("Marked as read"),
89
+ )
90
+ ],
91
+ reply_field=ReplyField(
92
+ on_replied=lambda text: print("Brutus replied:", text),
93
+ ),
94
+ on_clicked=lambda: print("Notification clicked"),
95
+ on_dismissed=lambda: print("Notification dismissed"),
96
+ sound=DEFAULT_SOUND,
97
+ )
98
+
99
+ # Run the event loop forever to respond to user interactions with the notification.
100
+ stop_event = asyncio.Event()
101
+ loop = asyncio.get_running_loop()
102
+
103
+ loop.add_signal_handler(signal.SIGINT, stop_event.set)
104
+ loop.add_signal_handler(signal.SIGTERM, stop_event.set)
105
+
106
+ await stop_event.wait()
127
107
 
128
- Any options or configurations which are not supported by the platform will be silently
129
- ignored.
108
+ asyncio.run(main())
109
+ ```
130
110
 
131
111
  ## Event loop integration
132
112
 
@@ -144,10 +124,6 @@ from rubicon.objc.eventloop import EventLoopPolicy
144
124
 
145
125
  # Install the event loop policy
146
126
  asyncio.set_event_loop_policy(EventLoopPolicy())
147
-
148
- # Get an event loop, and run it!
149
- loop = asyncio.get_event_loop()
150
- loop.run_forever()
151
127
  ```
152
128
 
153
129
  Desktop-notifier itself uses Rubicon Objective-C to interface with Cocoa APIs. A full
@@ -175,13 +151,26 @@ the resulting app bundle for notifications to work. An ad-hoc signature will be
175
151
  sufficient but signing with an Apple developer certificate is recommended for
176
152
  distribution and may be required on future releases of macOS.
177
153
 
178
- ## Requirements
154
+ ## Design choices
155
+
156
+ This package is opinionated in a few ways:
179
157
 
180
- * macOS 10.13 or higher
181
- * Linux desktop environment providing a dbus desktop notifications service
158
+ * It does not try to work around platform restrictions, such as changing the app icon on
159
+ macOS. Workarounds would be hacky and likely be rejected by an App Store review.
160
+ * The main API consists of async methods and a running event loop is required to respond
161
+ to user interactions with a notification. This simplifies integration with GUI apps.
162
+ * Dependencies are pure Python packages without extension modules. This simplifies app
163
+ bundling and distribution. We make an exception for Windows because interoperability
164
+ with the Windows Runtime is difficult to achieve without extension modules.
165
+ * If a certain feature is not supported by a platform, using it will not raise an
166
+ exception. This allows clients to use a wide feature set where available without
167
+ worrying about exception handling.
168
+ * If a notification cannot be scheduled, this is logged as a warning and does not raise
169
+ an exception. Most platforms allow the user to control if and how notifications are
170
+ delivered and notification delivery therefore cannot be taken as guaranteed.
182
171
 
183
172
  ## Dependencies
184
173
 
185
174
  * [dbus-next](https://github.com/altdesktop/python-dbus-next) on Linux
186
175
  * [rubicon-objc](https://github.com/beeware/rubicon-objc) on macOS
187
- * [winsdk](https://github.com/pywinrt/python-winsdk) on Windows
176
+ * [pywinrt](https://github.com/pywinrt/pywinrt) on Windows
@@ -4,28 +4,44 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "desktop-notifier"
7
- version = "5.0.0.dev2"
7
+ version = "6.0.0"
8
8
  authors = [{name = "Sam Schott", email = "sam.schott@outlook.com"}]
9
9
  license = {text = "MIT"}
10
10
  description = "Python library for cross-platform desktop notifications"
11
- keywords = ["desktop-notifier"]
11
+ keywords = [
12
+ "desktop-notifier",
13
+ "notifications",
14
+ "Notification Center",
15
+ "push notifications",
16
+ "Toast notifications",
17
+ ]
12
18
  classifiers = [
13
- "Development Status :: 2 - Pre-Alpha",
19
+ "Development Status :: 5 - Production/Stable",
14
20
  "Intended Audience :: Developers",
15
21
  "License :: OSI Approved :: MIT License",
16
22
  "Natural Language :: English",
23
+ "Operating System :: MacOS :: MacOS X",
24
+ "Operating System :: Microsoft :: Windows",
25
+ "Operating System :: OS Independent",
17
26
  "Programming Language :: Python :: 3",
18
27
  "Programming Language :: Python :: 3.7",
19
28
  "Programming Language :: Python :: 3.8",
20
29
  "Programming Language :: Python :: 3.9",
21
30
  "Programming Language :: Python :: 3.10",
22
31
  "Programming Language :: Python :: 3.11",
32
+ "Programming Language :: Python :: 3.12",
23
33
  "Programming Language :: Python :: 3 :: Only",
34
+ "Topic :: Communications",
35
+ "Topic :: Desktop Environment",
36
+ "Topic :: Desktop Environment :: Gnome",
37
+ "Topic :: Desktop Environment :: K Desktop Environment (KDE)",
38
+ "Topic :: Software Development :: Libraries :: Python Modules",
24
39
  ]
25
40
  requires-python = ">=3.7"
26
41
  dependencies = [
42
+ "bidict",
27
43
  "packaging",
28
- "dbus-next;sys_platform=='linux'",
44
+ "dbus-fast;sys_platform=='linux'",
29
45
  "rubicon-objc;sys_platform=='darwin'",
30
46
  "winrt-windows.applicationmodel.core;sys_platform=='win32'",
31
47
  "winrt-windows.data.xml.dom;sys_platform=='win32'",
@@ -48,16 +64,17 @@ dev = [
48
64
  "bump2version",
49
65
  "flake8",
50
66
  "flake8-pyproject",
67
+ "isort",
51
68
  "mypy",
52
69
  "pytest",
53
70
  "pytest-asyncio",
54
71
  "pytest-cov",
55
72
  ]
56
73
  docs = [
57
- "furo==2024.5.6",
58
- "sphinx==7.3.7",
59
- "sphinx-autoapi==3.1.2",
60
- "sphinx-mdinclude==0.6.1",
74
+ "furo==2024.8.6",
75
+ "sphinx==8.0.2",
76
+ "sphinx-autoapi==3.3.1",
77
+ "sphinx-mdinclude==0.6.2",
61
78
  ]
62
79
 
63
80
  [tool.setuptools.package-data]
@@ -80,3 +97,6 @@ files = ["src"]
80
97
  [tool.black]
81
98
  line-length = 88
82
99
  target-version = ["py37", "py38", "py39", "py310", "py311"]
100
+
101
+ [tool.isort]
102
+ profile = "black"
@@ -3,21 +3,21 @@
3
3
  Desktop notifications for Windows, Linux, macOS, iOS and iPadOS.
4
4
  """
5
5
  from .main import (
6
- DesktopNotifier,
6
+ DEFAULT_ICON,
7
+ DEFAULT_SOUND,
8
+ Attachment,
7
9
  Button,
8
- ReplyField,
9
- Notification,
10
- Urgency,
11
10
  Capability,
11
+ DesktopNotifier,
12
12
  Icon,
13
+ Notification,
14
+ ReplyField,
13
15
  Sound,
14
- Attachment,
15
- DEFAULT_SOUND,
16
- DEFAULT_ICON,
16
+ Urgency,
17
17
  )
18
18
  from .sync import DesktopNotifierSync
19
19
 
20
- __version__ = "5.0.0.dev2"
20
+ __version__ = "6.0.0"
21
21
  __author__ = "Sam Schott"
22
22
  __url__ = "https://github.com/samschott/desktop-notifier"
23
23