android-notify 1.2__tar.gz → 1.21__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.

Potentially problematic release.


This version of android-notify might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: android_notify
3
- Version: 1.2
3
+ Version: 1.21
4
4
  Summary: A Python package for sending Android notifications.
5
5
  Home-page: https://github.com/Fector101/android_notify/
6
6
  Author: Fabian
@@ -60,12 +60,21 @@ android.enable_androidx = True
60
60
 
61
61
  ### Example Notification
62
62
 
63
+ #### Basic Notification
64
+
63
65
  ```python
64
- from android_notify.core import send_notification
66
+ from android_notify import send_notification
65
67
 
66
68
  # Send a basic notification
67
69
  send_notification("Hello", "This is a basic notification.")
70
+ ```
71
+
72
+ **Example Image:**
73
+ ![Basic Notification](path/to/basic-notification-image.png)
68
74
 
75
+ #### Notification with an Image (Big Picture Style)
76
+
77
+ ```python
69
78
  # Send a notification with an image
70
79
  send_notification(
71
80
  title='Picture Alert!',
@@ -73,15 +82,29 @@ send_notification(
73
82
  style='big_picture',
74
83
  img_path='assets/imgs/icon.png'
75
84
  )
85
+ ```
76
86
 
87
+ **Example Image:**
88
+ ![Big Picture Notification](path/to/big-picture-notification-image.png)
89
+
90
+ #### Inbox Notification Style
91
+
92
+ ```python
77
93
  # Send a notification with inbox style
78
94
  send_notification(
79
95
  title='Inbox Notification',
80
96
  message='Line 1\nLine 2\nLine 3',
81
97
  style='inbox'
82
98
  )
99
+ ```
100
+
101
+ **Example Image:**
102
+ ![Inbox Notification](path/to/inbox-notification-image.png)
103
+
104
+ #### Big Text Notification
83
105
 
84
- # Send a Big Text notification (Note this send as a normal notification if not supported on said device)
106
+ ```python
107
+ # Send a Big Text notification
85
108
  send_notification(
86
109
  title='Hello!',
87
110
  message='This is a sample notification.',
@@ -89,12 +112,17 @@ send_notification(
89
112
  )
90
113
  ```
91
114
 
115
+ **Example Image:**
116
+ ![Big Text Notification](path/to/big-text-notification-image.png)
117
+
92
118
  ---
93
119
 
94
- ### **Assist** -- How to Copy image to app folder
120
+ ### **Assist**
121
+
122
+ - How to Copy image to app folder
95
123
 
96
124
  ```python
97
- import shutil # This module comes packaged with python
125
+ import shutil,os # These module comes packaged with python
98
126
  from android.storage import app_storage_path # type: ignore -- This works only on android
99
127
 
100
128
  app_path = os.path.join(app_storage_path(),'app')
@@ -103,6 +131,18 @@ image_path= "/storage/emulated/0/Download/profile.png"
103
131
  shutil.copy(image_path, os.path.join(app_path, "profile.png"))
104
132
  ```
105
133
 
134
+ - Avoiding Human Error when using different notification styles
135
+
136
+ ```python
137
+ from android_notify import NotificationStyles
138
+ send_notification(
139
+ title='Picture Alert!',
140
+ message='This notification includes an image.',
141
+ img_path='assets/imgs/icon.png'
142
+ style=NotificationStyles.BIG_PICTURE,
143
+ )
144
+ ```
145
+
106
146
  ---
107
147
 
108
148
  ### **Functions Reference**
@@ -183,6 +223,7 @@ Found a bug? Please open an issue on our [GitHub Issues](https://github.com/Fect
183
223
 
184
224
  - Fabian - <fector101@yahoo.com>
185
225
  - GitHub: <https://github.com/Fector101/android_notify>
226
+ - Twitter: <https://x.com/CodewithFabian> -- 😊 I'm sure to answer
186
227
 
187
228
  For feedback or contributions, feel free to reach out!
188
229
 
@@ -207,4 +248,4 @@ If you find this project helpful, consider buying me a coffee! Your support help
207
248
  ## 🌐 **Links**
208
249
 
209
250
  - **PyPI:** [android-notify on PyPI](https://pypi.org/project/android-notify/)
210
- - **GitHub:** [Source Code Repository](hhttps://github.com/Fector101/android_notify/)
251
+ - **GitHub:** [Source Code Repository](https://github.com/Fector101/android_notify/)
@@ -47,12 +47,21 @@ android.enable_androidx = True
47
47
 
48
48
  ### Example Notification
49
49
 
50
+ #### Basic Notification
51
+
50
52
  ```python
51
- from android_notify.core import send_notification
53
+ from android_notify import send_notification
52
54
 
53
55
  # Send a basic notification
54
56
  send_notification("Hello", "This is a basic notification.")
57
+ ```
58
+
59
+ **Example Image:**
60
+ ![Basic Notification](path/to/basic-notification-image.png)
55
61
 
62
+ #### Notification with an Image (Big Picture Style)
63
+
64
+ ```python
56
65
  # Send a notification with an image
57
66
  send_notification(
58
67
  title='Picture Alert!',
@@ -60,15 +69,29 @@ send_notification(
60
69
  style='big_picture',
61
70
  img_path='assets/imgs/icon.png'
62
71
  )
72
+ ```
63
73
 
74
+ **Example Image:**
75
+ ![Big Picture Notification](path/to/big-picture-notification-image.png)
76
+
77
+ #### Inbox Notification Style
78
+
79
+ ```python
64
80
  # Send a notification with inbox style
65
81
  send_notification(
66
82
  title='Inbox Notification',
67
83
  message='Line 1\nLine 2\nLine 3',
68
84
  style='inbox'
69
85
  )
86
+ ```
87
+
88
+ **Example Image:**
89
+ ![Inbox Notification](path/to/inbox-notification-image.png)
90
+
91
+ #### Big Text Notification
70
92
 
71
- # Send a Big Text notification (Note this send as a normal notification if not supported on said device)
93
+ ```python
94
+ # Send a Big Text notification
72
95
  send_notification(
73
96
  title='Hello!',
74
97
  message='This is a sample notification.',
@@ -76,12 +99,17 @@ send_notification(
76
99
  )
77
100
  ```
78
101
 
102
+ **Example Image:**
103
+ ![Big Text Notification](path/to/big-text-notification-image.png)
104
+
79
105
  ---
80
106
 
81
- ### **Assist** -- How to Copy image to app folder
107
+ ### **Assist**
108
+
109
+ - How to Copy image to app folder
82
110
 
83
111
  ```python
84
- import shutil # This module comes packaged with python
112
+ import shutil,os # These module comes packaged with python
85
113
  from android.storage import app_storage_path # type: ignore -- This works only on android
86
114
 
87
115
  app_path = os.path.join(app_storage_path(),'app')
@@ -90,6 +118,18 @@ image_path= "/storage/emulated/0/Download/profile.png"
90
118
  shutil.copy(image_path, os.path.join(app_path, "profile.png"))
91
119
  ```
92
120
 
121
+ - Avoiding Human Error when using different notification styles
122
+
123
+ ```python
124
+ from android_notify import NotificationStyles
125
+ send_notification(
126
+ title='Picture Alert!',
127
+ message='This notification includes an image.',
128
+ img_path='assets/imgs/icon.png'
129
+ style=NotificationStyles.BIG_PICTURE,
130
+ )
131
+ ```
132
+
93
133
  ---
94
134
 
95
135
  ### **Functions Reference**
@@ -170,6 +210,7 @@ Found a bug? Please open an issue on our [GitHub Issues](https://github.com/Fect
170
210
 
171
211
  - Fabian - <fector101@yahoo.com>
172
212
  - GitHub: <https://github.com/Fector101/android_notify>
213
+ - Twitter: <https://x.com/CodewithFabian> -- 😊 I'm sure to answer
173
214
 
174
215
  For feedback or contributions, feel free to reach out!
175
216
 
@@ -194,4 +235,4 @@ If you find this project helpful, consider buying me a coffee! Your support help
194
235
  ## 🌐 **Links**
195
236
 
196
237
  - **PyPI:** [android-notify on PyPI](https://pypi.org/project/android-notify/)
197
- - **GitHub:** [Source Code Repository](hhttps://github.com/Fector101/android_notify/)
238
+ - **GitHub:** [Source Code Repository](https://github.com/Fector101/android_notify/)
@@ -0,0 +1,2 @@
1
+ from .core import send_notification
2
+ from .styles import NotificationStyles
@@ -20,7 +20,7 @@ except Exception as e:
20
20
 
21
21
  if ON_ANDROID:
22
22
  try:
23
- # NotificationManagerCompat = autoclass('androidx.core.app.NotificationManagerCompat')
23
+ NotificationManagerCompat = autoclass('androidx.core.app.NotificationManagerCompat')
24
24
  NotificationCompat = autoclass('androidx.core.app.NotificationCompat')
25
25
 
26
26
  # Notification Design
@@ -82,8 +82,8 @@ def send_notification(title:str, message:str, style=None, img_path=None, channel
82
82
  # Get notification manager
83
83
  notification_manager = context.getSystemService(context.NOTIFICATION_SERVICE)
84
84
 
85
- importance= autoclass('android.app.NotificationManager').IMPORTANCE_HIGH # also works #NotificationManager.IMPORTANCE_DEFAULT
86
- # importance= NotificationManagerCompat.IMPORTANCE_HIGH #autoclass('android.app.NotificationManager').IMPORTANCE_HIGH also works #NotificationManager.IMPORTANCE_DEFAULT
85
+ # importance= autoclass('android.app.NotificationManager').IMPORTANCE_HIGH # also works #NotificationManager.IMPORTANCE_DEFAULT
86
+ importance= NotificationManagerCompat.IMPORTANCE_HIGH #autoclass('android.app.NotificationManager').IMPORTANCE_HIGH also works #NotificationManager.IMPORTANCE_DEFAULT
87
87
 
88
88
  # Notification Channel (Required for Android 8.0+)
89
89
  if BuildVersion.SDK_INT >= 26:
@@ -98,7 +98,6 @@ def send_notification(title:str, message:str, style=None, img_path=None, channel
98
98
  builder.setDefaults(NotificationCompat.DEFAULT_ALL)
99
99
  builder.setPriority(NotificationCompat.PRIORITY_HIGH)
100
100
 
101
- # Get Image
102
101
  img=None
103
102
  if img_path:
104
103
  try:
@@ -112,8 +111,6 @@ def send_notification(title:str, message:str, style=None, img_path=None, channel
112
111
  big_text_style = NotificationCompatBigTextStyle()
113
112
  big_text_style.bigText(message)
114
113
  builder.setStyle(big_text_style)
115
-
116
-
117
114
  elif style == "big_picture" and img_path:
118
115
  bitmap = BitmapFactory.decodeStream(context.getContentResolver().openInputStream(img))
119
116
  builder.setLargeIcon(bitmap)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: android_notify
3
- Version: 1.2
3
+ Version: 1.21
4
4
  Summary: A Python package for sending Android notifications.
5
5
  Home-page: https://github.com/Fector101/android_notify/
6
6
  Author: Fabian
@@ -60,12 +60,21 @@ android.enable_androidx = True
60
60
 
61
61
  ### Example Notification
62
62
 
63
+ #### Basic Notification
64
+
63
65
  ```python
64
- from android_notify.core import send_notification
66
+ from android_notify import send_notification
65
67
 
66
68
  # Send a basic notification
67
69
  send_notification("Hello", "This is a basic notification.")
70
+ ```
71
+
72
+ **Example Image:**
73
+ ![Basic Notification](path/to/basic-notification-image.png)
68
74
 
75
+ #### Notification with an Image (Big Picture Style)
76
+
77
+ ```python
69
78
  # Send a notification with an image
70
79
  send_notification(
71
80
  title='Picture Alert!',
@@ -73,15 +82,29 @@ send_notification(
73
82
  style='big_picture',
74
83
  img_path='assets/imgs/icon.png'
75
84
  )
85
+ ```
76
86
 
87
+ **Example Image:**
88
+ ![Big Picture Notification](path/to/big-picture-notification-image.png)
89
+
90
+ #### Inbox Notification Style
91
+
92
+ ```python
77
93
  # Send a notification with inbox style
78
94
  send_notification(
79
95
  title='Inbox Notification',
80
96
  message='Line 1\nLine 2\nLine 3',
81
97
  style='inbox'
82
98
  )
99
+ ```
100
+
101
+ **Example Image:**
102
+ ![Inbox Notification](path/to/inbox-notification-image.png)
103
+
104
+ #### Big Text Notification
83
105
 
84
- # Send a Big Text notification (Note this send as a normal notification if not supported on said device)
106
+ ```python
107
+ # Send a Big Text notification
85
108
  send_notification(
86
109
  title='Hello!',
87
110
  message='This is a sample notification.',
@@ -89,12 +112,17 @@ send_notification(
89
112
  )
90
113
  ```
91
114
 
115
+ **Example Image:**
116
+ ![Big Text Notification](path/to/big-text-notification-image.png)
117
+
92
118
  ---
93
119
 
94
- ### **Assist** -- How to Copy image to app folder
120
+ ### **Assist**
121
+
122
+ - How to Copy image to app folder
95
123
 
96
124
  ```python
97
- import shutil # This module comes packaged with python
125
+ import shutil,os # These module comes packaged with python
98
126
  from android.storage import app_storage_path # type: ignore -- This works only on android
99
127
 
100
128
  app_path = os.path.join(app_storage_path(),'app')
@@ -103,6 +131,18 @@ image_path= "/storage/emulated/0/Download/profile.png"
103
131
  shutil.copy(image_path, os.path.join(app_path, "profile.png"))
104
132
  ```
105
133
 
134
+ - Avoiding Human Error when using different notification styles
135
+
136
+ ```python
137
+ from android_notify import NotificationStyles
138
+ send_notification(
139
+ title='Picture Alert!',
140
+ message='This notification includes an image.',
141
+ img_path='assets/imgs/icon.png'
142
+ style=NotificationStyles.BIG_PICTURE,
143
+ )
144
+ ```
145
+
106
146
  ---
107
147
 
108
148
  ### **Functions Reference**
@@ -183,6 +223,7 @@ Found a bug? Please open an issue on our [GitHub Issues](https://github.com/Fect
183
223
 
184
224
  - Fabian - <fector101@yahoo.com>
185
225
  - GitHub: <https://github.com/Fector101/android_notify>
226
+ - Twitter: <https://x.com/CodewithFabian> -- 😊 I'm sure to answer
186
227
 
187
228
  For feedback or contributions, feel free to reach out!
188
229
 
@@ -207,4 +248,4 @@ If you find this project helpful, consider buying me a coffee! Your support help
207
248
  ## 🌐 **Links**
208
249
 
209
250
  - **PyPI:** [android-notify on PyPI](https://pypi.org/project/android-notify/)
210
- - **GitHub:** [Source Code Repository](hhttps://github.com/Fector101/android_notify/)
251
+ - **GitHub:** [Source Code Repository](https://github.com/Fector101/android_notify/)
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='android_notify',
5
- version='1.2',
5
+ version='1.21',
6
6
  author='Fabian',
7
7
  url='https://github.com/Fector101/android_notify/',
8
8
  description='A Python package for sending Android notifications.',
File without changes
File without changes