Skip to main content

A simple python package to send you and any other receiver an email when a portion of code is done running.

Project description

sonar_quality sonar_maintainability sonar_coverage pip

A simple python package to send you and any other receiver an email when a portion of code is done running.

Setup

Just run:

pip install notipy_me

Usage example

A basic usage example can be the following:

Usage as decorator

from notipy_me import Notipy

@Notipy("Long running script", send_start_mail=True)
def my_long_running_script():
    ...

Usage as context

from notipy_me import Notipy

with Notipy("Long running script", send_start_mail=True):
    my_long_running_script()

Setting the mail password

The script will ask you to insert the email, if you haven’t specified one, and its password, and then you’ll be set to go:

Please insert your email password:

Some additional settings

All the available settings are the following:

Notipy(
    task="task name", # name of the task you are executing.
    email="my_mail@myserver.com", # email from which send the emails.
    recipients=None, # List of recepients.
    port=465, # Server port, default one for using SSL.
    server=None, # SMTP server.
    send_start_mail=False # Whetever to send or not also a mail when the task starts.
)

Preview

You will receive mails such as the following (in both images the server name and email server has been deleted):

started completed

Known issues

Gmail

I cannot manage to get gmail to work, but it keeps rising an error logging in with the credentials, even though they are correct. With the other mail providers it works fine.

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

notipy_me-1.2.8.tar.gz (8.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page