A package to send an email when your function finished.
Project description
enotification
Introduction
enotification
is a small package based on zmail, used to email you when your function is finished.
Installation
pip install enotification
Requirements
Since enotification
is based on zmail, you should meet the requirements of zmail:
Before using it, please ensure:
- Using python3
- Open SMTP/POP3 functions in your mail (For @163.com and @gmail.com you need to set your app private password)
Then, all you need to do is just import zmail.
Note, since this package uses f-string, thus it requires Python>=3.6.
QuickStart
enotification
is designed as a decorator class
from enotification import ENotification
import time
@ENotification(send_from="your email", password="your email password")
def test_func():
print("test!")
time.sleep(10)
if __name__ == "__main__":
test_func()
# your email would receive an email like this:
# subject: This is a notification from enotification!
# content:
# Your function test_func is finished!
# Start time: 2021-04-23 11:13:54
# End time: 2021-04-23 11:14:04
# Time cost: 0:00:10!
TODO
- Ask user to input her email account or password if it is empty (using getpass module). Usage:
@ENotification()
. Note: the()
is must.
Q & A
If the notification email is not sent correctly, please read zmail's Q&A part to see more specific configurations.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
enotification-0.0.6.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for enotification-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da913ff7c0db34f66f6488ba0a42ea65755c978c04f87aa9897e98691a0c0d29 |
|
MD5 | 0dae8776f7de37f95c4b73eccdd82031 |
|
BLAKE2b-256 | ab1daaca5a64d9eab58bfbcd4229a2728daaee13e4868bc2ea6e8dfba2e09864 |