Github:

https://github.com/somniumism/bwa

Document(Korean ver):

Bwa: Simple Notification Sender

πŸ‘€ Introduction


bwa is a simple notifcation sender, that can send notifications related to the execution of functions by using a single decorator. With few client settings, just insert the decorators right above some functions. You can receive a notification when the function starts, completes, or raises an unexpected error. Currently, bwa supports four clients; Discord, Slack, Telegram and Gmail.

If you set your webhook url as an environment variable, you will be notified quite simply as follows:

from bwa.discord import deco_noti

@deco_noti()
def run():
    print("Hi, bwa!")

Furthermore, the method send_noti() provided by bwa lets you send notifications to the your webhook, e-mail, or bot at any time and wherever in your code you want.

from bwa.slack import send_noti

def run():
		print("Start")
		send_noti(custom_content="Start")
		print("End")
		send_noti(custom_content="End")

if your function ended unexpectedly due to an exception or error, you will be notified in the format below for the time that was terminated, runtime, and error information.

😭 Your function <function_name> ended unexpectedly due to an exception or error.
    - function name: function_name
    - start time: 2020-10-25 01:25:06
    - dead time: 2020-10-25 01:25:12
    - run time: 0:00:05.774958
    - Error Info:

    - Traceback:
    Traceback (most recent call last):
    File "/Users/test-user/test/gmail_test_case.py", line 83, in wrapper

πŸ”¨ Installation


By using pip , you can install bwa. Simply install it using the command below.