Skip to main content

#ENotiPy

###Description ENotipy is a simple script that emails the users upon code completion or failure.

###Environment Setup ENotipy requires 4 environment variables to be setup prior to use. These variables can be set 3 different ways. The first is manually. For a bash shell this would look something like:

export ENOTIPY_EMAIL="dev.notipy@gmail.com"
export ENOTIPY_KEY="SuperSecretPassword"
export ENOTIPY_SMTP="smtp.gmail.com"
export ENOTIPY_PORT="587"

The next way is the info file. These commands can also be placed in a file like the SAMPLE_INFO file provided and passed to the infoFileEnvSetup(./SAMPLE_INFO) function in a script or using -i=SAMPLE_INFO as a command line argument.

The final way is to request environment setup prompts. This can be done with requestEnvSetup() in a script or -r=True on the command line.

For examples of these options, checkout scriptExample and codeExample.py

Note that to use strictly "enotipy" on the commandline that the package must be installed via pip. Otherwise, replace "enotipy" with "python /path/to/enotipy.py".

###Script Examples ####commands: To access the help menu you can invoke

enotipy -h #Brings up help menu

Environment set up can be done with prompts by as

enotipy "python scriptCodeExample.py" -r=True #Execute with env setup request

or using an info file as

enotipy "python scriptCodeExample.py" -i=SAMPLE_INFO #Execute with env setup info file

If you want to use a sample info file SAMPLE_INFO use

enotipy -g #Generates SAMPLE_INFO

The command can also be given a timeout time in minutes

enotipy "python scriptCodeExample.py" -t=60 #timeout after 60 minutes

####scriptExampleCode.py:

def test_fcn(*args):
    x, = args;
    for i in range(x):
        print(i)

if __name__ == "__main__":
    test_fcn(100)

###Code Example If you want to use ENotipy in a code it can be used as

import enotipy.enotipy as enotipy
if __name__ == "__main__":
    #The function to be executed
    def test_fcn(*args):
        x, = args;
        for i in range(x):
            print(i)

    # notipy.requestEnvSetup() #This option requests user input to set environment
    args = (10,)
    enotipy.infoFileEnvSetup("./INFO") #This option sets the environment with an info file
    # enotipy.infoFileEnvSetup("./SAMPLE_INFO") #This option sets the environment with an info file
    notifier = enotipy.ENotiPy() #Creating notipy object
    notifier.run(test_fcn,*args) #Calling run to execute the function and send email when completed.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

enotipy-1.0.2.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file enotipy-1.0.2.tar.gz.

File metadata

  • Download URL: enotipy-1.0.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for enotipy-1.0.2.tar.gz
Algorithm Hash digest
SHA256 b7b5dac72a6420ae67e3e7ac39f75a588e5303af21eeb2b7f704d53fa29bd905
MD5 d455569fcdb10c5ae882eda4995ab5a6
BLAKE2b-256 601b97e095bff102750c9ea83daf56d57d0c9318d1d6e9899462901e62418d2e

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 Sentry Error logging StatusPage Status page