A convenient email sender for monitoring your task
Project description
py_reminder
This is a Python decorator that can send email for various purpose.
By the way, I am also planning to expand the receiving channels from email to Message, Telegram, Wechat, or even more.
If you are interested, let's work together!
Introduction
Often we have some time-consuming script, and we want to leave it running for a while without having to check every few minutes if it has been completed.
This package will offer you a one-line experience (a function decorator) of sending you email report with customized information.
This is definitely an easy function, I believe many guys have written their own equivalent one. What I did is to simplify it into a decorator, so it is now even more convenient!
Installation
pip install py_reminder==1.0.1
Initial configuration
We strongly recommend to use an unimportant mailbox to send messages, since the password is going to be stored in plain text. We're looking for ways to work around this - you're welcome to help!
For the first time, you should specify configuration:
from py_reminder import config
config(address='your_email@example.com',
password='123456',
smtp='smtp.example.com',
port=999, # currently it should be non-SSL port
default_to='receiver@example.com')
You can ignore default_to
. It will set to be the same as address
by default.
If you receive a testing email, then the configuration is done.
Sample code
from py_reminder import monitor
@monitor('This is a task')
def foo():
return 0
foo()
If you want to specify the receiver:
@monitor(task='This is a task', to='receiver@example.com')
Another way to use it without decorator:
from py_reminder import send_email
send_email(task="This is a task")
And you will see:
For error, you will see:
Email Service Provider
- GMail
- I used a new registered account and was banned after one day.
- Haven't tested personal account yet.
- Foxmail
- I use my personal account and it is all good up to now (two months).
- 163
- It works. Port should be
25
.
- It works. Port should be
Tests on other email vendors are welcome!
I have some worked config files. You can simply copy paste it to the ~/.config
then skip the configuration process. If you would like to use the config files, just send email to me.
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
Built Distribution
File details
Details for the file py_reminder-1.0.2.tar.gz
.
File metadata
- Download URL: py_reminder-1.0.2.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ad691d45e7bd796e92ab22455f87b98b80c9eadd8f4a743bda72a8bf45330bf |
|
MD5 | 1ab2f594a2d32f817593ac1cdf37e7ad |
|
BLAKE2b-256 | ab01b478574bc8aa9359d1692704c66c082c4366b502fd273e70f7c3bcbaa076 |
File details
Details for the file py_reminder-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: py_reminder-1.0.2-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d986add4546fb39d8f0632199f19fb926c3aaaec649ebe8ae26d9e27da68fb06 |
|
MD5 | bcc1defdabea2d98a6e3e1c521a48386 |
|
BLAKE2b-256 | ba0225fe39aae47c23ec9a85f94fc9874a2df8d5a1459a99f957bef618b4130d |