Skip to main content

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.7.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

enotification-0.0.7-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file enotification-0.0.7.tar.gz.

File metadata

  • Download URL: enotification-0.0.7.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for enotification-0.0.7.tar.gz
Algorithm Hash digest
SHA256 3dcebad1c63509188069ead75ee8dc85d428d49eae60839748d196c93382ca98
MD5 8d41dc37ad0ef474c2d4742fc319b394
BLAKE2b-256 a2b5e2f9c4438f5af99de6ef2bb906a8c73304e7c606c8b7432c0960471876c2

See more details on using hashes here.

File details

Details for the file enotification-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: enotification-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for enotification-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 82c85e1454a82611e25aef403d4e8b86583f0f9140620bf65101c531cca1bc1d
MD5 9fda910184dc73dbc2f70ef2c4b186a1
BLAKE2b-256 22e7bef941dd64a27803a29c88ca5c6d036c05ab0d4272566a062d7639bef8a6

See more details on using hashes here.

Supported by

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