Skip to main content

email_function_failure_traceback

This is a decorator for monitoring errors for remote jobs. Wrap your main function in the email_function_failure_traceback decorator, and if the function fails, an email will be sent based on your configuration that includes the traceback of the error (including SQL errors).

Installation

pip install email_function_failure_traceback

Functions:

email_function_failure_traceback(send_email_function)

Examples:

cache_to_disk

"""
This example caches the function "my_function" for 3 days.
"""
from functools import partial
from email_function_failure_traceback import email_function_failure_traceback


# Implement this yourself using your preferred Email integration...
def send_email(message, subject_line, to_address, from_address):
    Email(to_address, from_address, subject_line, message)


@email_function_failure_traceback(
    partial(
        send_email,
        subject_line='my function failed',
        to_address='example@example.com',
        from_address='example@example.com'))
def my_function():
    assert 1 == 2


# This will send an email to `example@example.com` with the error traceback.
my_function()

Metadata

Release files for email-function-failure-traceback 0.0.2

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

Source distribution (sdist)

Source distribution for email-function-failure-traceback 0.0.2
File Size Uploaded
email_function_failure_traceback-0.0.2.tar.gz 1.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for email-function-failure-traceback 0.0.2
File Interpreter ABI Platform
email_function_failure_traceback-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 4.2 kB

Release files / email_function_failure_traceback-0.0.2.tar.gz

Download URL email_function_failure_traceback-0.0.2.tar.gz
Size 1.9 kB
Tags Source
SHA-256 checksum
How to use checksums
96b0a82f8242cfd7f1d45b433f83cbc2913a0e288965e8b761fd1de4bd874bd5
BLAKE2b-256 checksum
How to use checksums
3656fd0f3c727114015ddb8c73cc15d3f4406eb01e58c7289a30c17297497f33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10

Release files / email_function_failure_traceback-0.0.2-py3-none-any.whl

Download URL email_function_failure_traceback-0.0.2-py3-none-any.whl
Size 2.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bf249bed2494262202f40243d96bf6c2ca962e62d1bea87d6b9222eab1b57c8
BLAKE2b-256 checksum
How to use checksums
3deeea7b90a92ef0811e0f10d1e81caea1e8854fc8a5e04801ee96c1f3e56d65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

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