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.

Metadata

Release files for enotipy 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for enotipy 1.0.3
File Size Uploaded
enotipy-1.0.3.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for enotipy 1.0.3
File Interpreter ABI Platform
enotipy-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 12.0 kB

Release files / enotipy-1.0.3.tar.gz

Download URL enotipy-1.0.3.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
dbd61349113d4cf79becdce83990c8a60f37ca392c5a164ae29c86cc2178a7fa
BLAKE2b-256 checksum
How to use checksums
dbbf67b9d2704c40edacd5f5c7c0fd707784438f68c8672c475bff6b70753e32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.2

Release files / enotipy-1.0.3-py3-none-any.whl

Download URL enotipy-1.0.3-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b88f9af866aaee156c6fcafea5ada109a1038ccfaf81affc931064a272c7b99
BLAKE2b-256 checksum
How to use checksums
83a652818671f852be359356ab5521da82fe1309fdb1f4407a5e3ab82523d629
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.2

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

1 release file

1.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page