ExceptNotifier
The Python package ExceptNotifier enhances the try-except statement, allowing you to receive detailed error messages via email or messenger apps.
Install / Use
/learn @dsdanielpark/ExceptNotifierREADME
Development Status :: 3 - Alpha <br> Copyright (c) 2023 MinWoo Park, South Korea<br>
Preparing a beta release, including usability improvements, refactoring, and document simplification.
You can contribute by reading the contribution rules and guidelines.


Provides a notification from the application shown in the captured screen.
Python Package: ExceptNotifier

The ExceptNotifier Python package offers a flexible approach to receiving notifications by enhancing Python's try-except statement. This package enables you to receive alerts through various messaging applications or emails. <Br><br> With ExceptNotifier, you can obtain detailed compilation errors, including debug information, sent directly to your preferred messaging platform or email. By integrating OpenAI's ChatGPT, you can receive additional error code information as long as you provide the required API model name and key. This feature ensures that error handling and notifications are more informative and accessible, streamlining your debugging process.

Except Notifier Is All You Need.
Although most explanations involve the try-except block, in actual use cases, once you override the ExceptNotifier only once, an alert will be sent to the pre-configured messenger application when an error occurs, even without the try-except statement.
When you look at the GIF in Python Package Co-Coder, you can see what it means that even when overriden once, a message is sent every time an exception occurs at different code line or shell in ipython. Be sure to check it out.
<br>Supporting Applications
Applicable to both IPython and Python, but needs to be ported differently only in ExceptNotifier. Please refer to the detailed example. (SuccessNotifier and SendNotifier have the same syntax.)
- Telegram
- Discord
- Slack
- Google Mail
- Line
- AWS Chime
- Microsoft Teams
- Kakao Talk
- Wecaht
- SMS Sending using Twilio
- Desktop Notification using Plyer
- Beep Sound from system
- Opea AI API - If you have OpenAI API Key and model name, you can get information and code examples for debugging in any application.
- Google Bard Python package BardAPI - Starting from Exceptnotifier version 0.2.5 - Using the Python package Bard API, if you declare the __Secure-1PSID value as a global variable , you can receive debugging hints and explanations about errors in your code through Google Bard. <br>
Install
The latest stable release (and required dependencies) can be installed from PyPI(v0.2.11):
pip install ExceptNotifier
You may instead want to use the development version from Github for contributing:
pip install git+https://github.com/dsdanielpark/ExceptNotifier.git
<br><br><br>
Contents
- <Br>
<br><br><br>
<br>App Setup Overview
- The variables in the following table must not be contaminated.
- Depending on the situation, consider designating them as global variables for use.
- As you already know, API Keys or security tokens must be secured. Note that the key values which exposured in github will be expired after insecured.
- We are trying to maintain the current architecture as much as possible by considering various methods such as inheriting decorators and Excepthook. We set it as an environment variable as follows, and we are refactoring and testing for a better method.
| App | Required Enviroment Variables | Free or Paid | Ease of Setup | Time Required for Setup|Guide Tutorial Link|
|:--:|:--|:--:|:--:|:--:|:---:|
|Beep|N/A|Free|N/A|0min|ExceptBeep|
|Desktop|N/A|Free|N/A|0min|ExceptDesktop|
|Telegram|_TELEGRAM_TOKEN|Freemium|Easy|2min|ExceptTelegram |
|Discord|
_DISCORD_WEBHOOK_URL|Freemium|Easy|1min|ExceptDiscord |
|AWS Chime|
_CHIME_WEBHOOK_URL|Freemium|Easy|1min|ExceptChime |
|Slack|
_SLACK_WEBHOOK_URL|Freemium|Easy|3min|ExceptSlack |
|G-Mail|
_GAMIL_RECIPIENT_ADDR, _GMAIL_SENDER_ADDR, _GMAIL_APP_PASSWORD_OF_SENDER |Restricted free|Medium|3min|ExceptMail |
|Line|
_LINE_NOTIFY_API_TOKEN|Freemium|Medium|4min|ExceptLine |
|SMS|
_TWILIO_SID, _TWILIO_TOKEN, _RECIPIENT_PHONE_NUMBER, _SENDER_PHONE_NUMBER|Not free|Medium|5min|ExceptSMS |
|Microsoft Teams|
_TEAMS_WEBHOOK_URL|Not Free|Medium|5min|ExceptTeams|
|KakaoTalk|_KAKAO_TOKEN_PATH|Freemium|Hell|>=10min(Token refreshes daily)|ExceptKakao|
If you add the following two variables to the required variables for each application in the table above, you can receive error location and explanation, as well as examples, from OpenAI's model
| API | Required Variables | Free or Paid | Ease
