Write emails after finishing a task
Project description
TaskMessenger
Tool to send a designated email after task is finished
Introduction
Waiting for the termination of a long task can be tedious and unpractical. Instead, it would be useful if an email reminder can be sent automatically at the termination of a task. This package allows for such functionality.
Requirements
- Python >=3.6
Installation
pip install taskmessenger
Example:
Sending a message within the function:
from taskmessenger.send import CompleteMessage,EmailData
c = CompleteMessage("user@example.com") #Use specified email with the default optional arguments
@c.send_function_specific_email(lambda x: EmailData("Output from 'a'",str(x))) #Send email message based on the second element of the tuple
def a(i): #Function will return i**2 and send as an email [Subject: i, Body: i**2]
return (i**2,EmailData(str(i),str(i**2)))
print(a(66)) #4356
Sending a function value-independent message:
from taskmessenger.send import CompleteMessage,EmailData
c = CompleteMessage("user@example.com")
e = EmailData("SUBJECT","BODY")
@c.send_email_after(e) #Send message
def func():
print("Doing something...")
func()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
taskmessenger-1.0.1.tar.gz
(4.1 kB
view details)
File details
Details for the file taskmessenger-1.0.1.tar.gz
.
File metadata
- Download URL: taskmessenger-1.0.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 585ed63ddc134b53583aa0f7f33beafef655b5320617894c4250587cf50c3799 |
|
MD5 | ecee9fd6d55eb2ac1e43a4b71185cd0c |
|
BLAKE2b-256 | 333e5a03973f20181f1a9277b06120e27ac6f3ccf289807c081290ce0b72768f |