ExceptNotifier


NameExceptNotifier JSON
Version 0.1.7 PyPI version JSON
download
home_pagehttps://github.com/dsdanielpark/ExceptNotifier
SummaryWith Python's try-except to receive notifications about Errors or Successes in your code through messenger app or email.
upload_time2023-04-19 17:59:06
maintainer
docs_urlNone
authordaniel park
requires_python>=3.6
license
keywords exception python python exception alarm error notifications customizable notifications traceback management single line alarm
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Development Status :: 3 - Alpha <br>
*Copyright (c) 2023 MinWoo Park, South Korea*
<br>
![](https://github.com/dsdanielpark/ExceptNotifier/blob/main/assets/imgs/ExceptNotifier_logo.png)

<h3 align="center">Integrates AI-assisted debugging notifications into Python try-except statements for various messaging applications. </h3>

<p align="center">
<a href="(https://img.shields.io/badge/pypi-ExceptNotifier-orange"></a>
<a href="https://pypi.org/project/exceptnotifier/"><img alt="PyPI" src="https://img.shields.io/pypi/v/exceptnotifier"></a>
<a href="https://pepy.tech/project/exceptnotifier"><img alt="Downloads" src="https://pepy.tech/badge/exceptnotifier"></a>
<a href="https://anaconda.org/conda-forge/exceptnotifier/"><img alt="conda-forge" src="https://img.shields.io/conda/dn/conda-forge/exceptnotifier.svg?label=conda-forge"></a>
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
</p>

![](https://github.com/dsdanielpark/ExceptNotifier/blob/main/assets/imgs/main2.png)

# Python Package: ExceptNotifier
##### Provides a notification from the application shown in the captured screen.
 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.

<Br>

#### Could you kindly add this badge to your repository?

```
![Except-Notifier](https://img.shields.io/badge/pypi-ExceptNotifier-orange)
```


<br><br>

### Supporting Applications

- [Telegram](https://telegram.org/)
- [Discord](https://discord.com/)
- [Slack](https://slack.com/)
- [Google Mail](https://mail.google.com/)
- [Line](https://line.me/en/)
- [AWS Chime](https://aws.amazon.com/ko/chime/download-chime/)
- [Microsoft Teams](https://www.microsoft.com/en/microsoft-teams/download-app)
- [Kakao Talk](https://www.kakaocorp.com/page/service/service/KakaoTalk?lang=en)
- SMS Sending using [Twilio](https://www.twilio.com/en-us)
- Desktop Notification using [Plyer](https://github.com/kivy/plyer)
- Beep Sound from [system](https://docs.python.org/3/library/winsound.html)

<Br>

### AI Debugging using OpenAI API
If you have OpenAI API Key and model name, you can get information and code examples for debugging in any application.
- [OPEN AI API](https://platform.openai.com/docs/introduction)


<br><br>

# Quick Start
```bash
pip install ExceptNotifier
pip install exceptnotifier

conda install ExceptNotifier
conda install exceptnotifier
```

<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.
- If you are using Telegram, an example is attached as an image.
- 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.

| App | Required Variables | Free or Paid | Ease of Setup | Time Required for Setup|Guide Tutorial Link|
|:--:|:--|:--:|:--:|:--:|:---:|
|Beep|N/A|Free|N/A|0 min|[ExceptBeep](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptBeep/GUIDE.md)|
|Desktop|N/A|Free|N/A|0 min|[ExceptDesktop](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptDesktop/GUIDE.md)|
|Telegram|`_TELEGRAM_TOKEN`|Freemium|Easy|2min|[ExceptTelegram](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptTelegram/GUIDE.md)|
|Discord|`_DISCORD_WEBHOOK_URL`|Freemium|Easy|1min|[ExceptDiscord](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptTelegram/GUIDE.md)|
|AWS Chime|`_CHIME_WEBHOOK_URL`|Freemium|Easy|1min|[ExceptChime](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptChime/GUIDE.md)|
|Slack|`_SLACK_WEBHOOK_URL`|Freemium|Easy|3min|[ExceptSlack](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptSlack/GUIDE.md)|
|G-Mail|`_GAMIL_RECIPIENT_ADDR`, `_GMAIL_SENDER_ADDR`, `_GMAIL_APP_PASSWORD_OF_SENDER` |Restricted free|Medium|3min|[ExceptMail](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptMail/GUIDE.md)|
|Line|`_LINE_NOTIFY_API_TOKEN`|Freemium|Medium|4min|[ExceptLine](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptLine/GUIDE.md)|
|SMS|`_TWILIO_SID`, `_TWILIO_TOKEN`, `_RECIPIENT_PHONE_NUMBER`, `_SENDER_PHONE_NUMBER`|Not free|Medium|5min|[ExceptSMS](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptSMS/GUIDE.md)|
|Microsoft Teams|`_TEAMS_WEBHOOK_URL`|Not Free|Medium|5min|[ExceptTeams](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptTeams/GUIDE.md)|
|KakaoTalk|`_KAKAO_TOKEN_PATH`|Freemium|Hell|>=10min(Token refreshes daily)|[ExceptKakao](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptKakao/GUIDE.md)|


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 of Setup | Time Required for Setup|Guide Tutorial Link|
|:--:|:--|:--:|:--:|:--:|:---:|
| OpenAI API |`Required variables for each application`+ `_OPEN_AI_MODEL`,`_OPEN_AI_API`|Not free|Easy|2min|[APIOpenAI](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/APIOpenAI/GUIDE.md)|


<br><br>

# 1. Key Features
To use the desired application, you must define the necessary variables. Ensure that the variable names remain unchanged, and you can use either local or global variables. If you are using `Telegram`, an example is attached as an image.

## 1-1. Except`[appName]`
If you use Python's try except statement as it is, but change except as follows, you can receive notifications through your application.
```
ExceptChime, ExceptTelegram, ExceptDiscord, ExceptSMS, ExceptMail, ExceptKakao, ExceptLine, ExceptSlack, ExceptTeams, ExceptDesktope, ExceptBeep
```

*Example*
```python
from ExceptNotifier import ExceptTelgeram
_TELEGRAM_TOKEN = "xxxx"

try:
    print(1/0)
except ExceptTelegram:    # sending except message to telegram
    sys.exit()
```
![](https://github.com/dsdanielpark/ExceptNotifier/blob/main/assets/imgs/ex1.png)

<br>

## 1-2. AI Debbugging Infomation Notification
You can receive debugging information from ChatGPT via OpenAI's API when using the Except statement. The syntax remains the same, but you'll need to configure these two variables:
`_OPEN_AI_MODEL`,`_OPEN_AI_API`

*Example*
```python
from ExceptNotifier import ExceptTelgeram
_TELEGRAM_TOKEN = "xxxx"
_OPEN_AI_MODEL="gpt-3.5-turbo"
_OPEN_AI_API="sk-xxxxxx"

try:
    print(1/0)
except ExceptTelegram: # sending msg WITH AI DEBUGGING to telegram
    sys.exit()
```

![](https://github.com/dsdanielpark/ExceptNotifier/blob/main/assets/imgs/ex2.png)

<br>

## 1-3. Success`[appName]`
By placing the try except in python at the end of the try statement, applications can be notified that the try statement worked normally.
```
SuccessChime, SuccessTelegram, SuccessDiscord, SuccessSMS, SuccessMail, SuccessKakao, SuccessLine, SuccessSlack, SuccessTeams, SuccessDesktope, SuccessBeep
```
*Example*

```python
from ExceptNotifier import SuccessTelgeram
_TELEGRAM_TOKEN = "xxxx"

try:
    print(1/20)
    SuccessTelgeram().__call__()  # sending success message to telegram
except:
    sys.exit()
```

![](https://github.com/dsdanielpark/ExceptNotifier/blob/main/assets/imgs/ex3.png)

<Br>

## 1-4. Send`[appName]`
Place it anywhere on the line of code you want, and you'll be notified when that line of code is reached.
```
SendChime, SendTelegram, SendDiscord, SendSMS, SendMail, SendKakao, SendLine, SendSlack, SendTeams, SendDesktope, SendBeep
```
*Example*

```python
from ExceptNotifier import SendTelgeram
_TELEGRAM_TOKEN = "xxxx"

SendTelegram().__call__() # sending message to telegram

noti = SendTelegram()
noti()                    # sending message to telegram
```

![](https://github.com/dsdanielpark/ExceptNotifier/blob/main/assets/imgs/ex4.png)


<br><br>

# 2. Features
You can receive debugging information from ChatGPT via OpenAI's API when using the Except statement. The syntax remains the same, but you'll need to configure these two variables:
`_OPEN_AI_MODEL`,`_OPEN_AI_API`



## 2-1. *Telegram Notifier*

- a. Open your telegram app and search for BotFather. (A built-in Telegram bot that helps users create custom Telegram bots) <br>
- b. Type /newbot to create a new bot <br>
- c. Give your bot a name & a username <br>
- d. Copy your new Telegram bot’s token <br>

For more infomation, visit [Telegram Bot Father API](https://core.telegram.org/bots/api)
<br><br>
 
### a. Without OpenAI API

```python
from ExceptNotifier import ExceptTelegram, SuccessTelegram, SendTelegram
import sys
sys.excepthook = ExceptTelegram.__call__

_TELEGRAM_TOKEN = "xxxx"

try:
    print(1/0)  
    SuccessTelegram().__call__() #1. success sender          

except ExceptTelegram as e:      #2. except sender            
    sys.exit()

SendTelegram().__call__()        #3. customized sender     
```


![](https://github.com/dsdanielpark/ExceptNotifier/blob/main/assets/imgs/fig44.png)


### b. With OpenAI API
```python
from ExceptNotifier import ExceptTelegram, SuccessTelegram, SendTelegram
import sys
sys.excepthook = ExceptTelegram.__call__

_TELEGRAM_TOKEN = "xxxx"
_OPEN_AI_MODEL="gpt-3.5-turbo"
_OPEN_AI_API="sk-xxxxxx"

try:
    print(1/0)  
    SuccessTelegram().__call__() #1. success sender          

except ExceptTelegram as e:      #2. except sender            
    sys.exit()

SendTelegram().__call__()        #3. customized sender     

```
<br>

## 2-2. *Mail Notifier*
In the except statement, an email is sent along with the error message. Additionally, you can send emails from any desired line. <br>
- a. Log in with the sender's email ID. <br>
- b. Obtain an app password for sending Google Mail at the following [link](https://myaccount.google.com/u/3/apppasswords?utm_source=google-account&utm_medium=myaccountsecurity&utm_campaign=tsv-settings&rapt=AEjHL4N2bMRWO46VaMp_jP06zQK14BWNPv66l2o59iJ99CkO8BjYnmoRUe9dtSchkkbubHZMUhevkAnwVJRHb9ygO3afispNlw) or [google document](https://support.google.com/accounts/answer/185833?hl=en). 

```python
import sys
from ExceptNotifier import ExceptMail, SuccessMail, SendMail
sys.excepthook = ExceptMail.__call__

# Define the next two variables optionally when using OpenAI's API.
# _OPEN_AI_MODEL="gpt-3.5-turbo"    
# _OPEN_AI_API="sk-xxxxxx"
_GAMIL_RECIPIENT_ADDR = 'xxxxxxx@gmail.com'
_GMAIL_SENDER_ADDR = 'yyyyyy@gmail.com'
_GMAIL_APP_PASSWORD_OF_SENDER = 'zzzzzz'

try:
    main()                      # Your Code Here
    SuccessMail().__call__()    # No Exception -> Send Success mail.
except ExceptMail:              # Exception -> Send Fail mail.
    pass

SendMail().__call__()           # When Process Ended -> Any Line mail.
```

<details>
<summary> See Example...</summary>

```python
import sys
from ExceptNotifier import ExceptMail, SuccessMail, SendMail

# Define the next two variables optionally when using OpenAI's API.
# _OPEN_AI_MODEL="gpt-3.5-turbo"    
# _OPEN_AI_API="sk-xxxxxx"
_GAMIL_RECIPIENT_ADDR = 'xxxxxxx@gmail.com'
_GMAIL_SENDER_ADDR = 'yyyyyy@gmail.com'
_GMAIL_APP_PASSWORD_OF_SENDER = 'zzzzzz'

sys.excepthook = ExceptMail.__call__

try:
    # 02.Locate your code
    print(1/0)   
    SuccessMail().__call__()   # Success Mail

except ExceptMail as e:        # Exception Mail       
    sys.exit()
    print(e)

SendMail().__call__()          # Put Any Line: Sending mail
```
</details>

<details>
<summary> Snippet for Python developers...</summary>

```python
import sys
from ExceptNotifier import ExceptMail, SuccessMail, SendMail
sys.excepthook = ExceptMail.__call__

# Define the next two variables optionally when using OpenAI's API.
# _OPEN_AI_MODEL="gpt-3.5-turbo"    
# _OPEN_AI_API="sk-xxxxxx"
_GAMIL_RECIPIENT_ADDR = 'xxxxxxx@gmail.com'
_GMAIL_SENDER_ADDR = 'yyyyyy@gmail.com'
_GMAIL_APP_PASSWORD_OF_SENDER = 'zzzzzz'

try:
    'your code'
    SuccessMail().__call__()
except ExceptMail:
    pass

SendMail().__call__() 
```
</details>

<br>

## 2-3. *Discord Notifier*
- a. Select the channel to receive notifications.
- b. Click "Edit Channel" in the upper right corner of the chat window.
- c. Click Integrations - Webhook - New Webhook.
- d. Then click Copy Webhook.

```python
import sys
from ExceptNotifier import ExceptDiscord, SuccessDiscord, SendDiscord
sys.excepthook = ExceptDiscord.__call__

# Define the next two variables optionally when using OpenAI's API.
# _OPEN_AI_MODEL="gpt-3.5-turbo"    
# _OPEN_AI_API="sk-xxxxxx"
_DISCORD_WEBHOOK_URL = "xxxxxxxxxxxxxxxxx"


try:
    print(1/20)  
    SuccessDiscord().__call__() #1 success sender          
except ExceptDiscord as e:      #2 except sender            
    sys.exit()

SendDiscord().__call__()        #3 customized sender       
```

<br>

## 2-4. *Chime Notifier*
- a. Select the Chat room to receive notifications.
- b. Click "Room Setting" in the upper right corner.
- c. Click "Manage Webhook and bot."
- d. Create Add Webhook, set it up, then click Copy Webhook.
```python
import sys
from ExceptNotifier import SuccessChime, ExceptChime, SendChime
sys.excepthook = ExceptChime.__call__

# Define the next two variables optionally when using OpenAI's API.
# _OPEN_AI_MODEL="gpt-3.5-turbo"    
# _OPEN_AI_API="sk-xxxxxx"
_CHIME_WEBHOOK_URL = "xxxxxxxxxxxxxxxxxx"


try:
    print(1/0)  
    SuccessChime().__call__() #1 success sender          
except ExceptChime as e:      #2 except sender            
    sys.exit()

SendChime().__call__()        #3 customized sender       
```
<br>

## 2-5. *Slack Notifier*
- a. visit https://api.slack.com/
- b. `Create an app` - `From scratch` - `Create App`
- c. Add webhook: Click `Incoming Webhooks` - Activate Incomming `On` - Add New Webhook to Workspace
- d. Copy `Webhook URL`

```python
import sys
from ExceptNotifier import ExceptSlack, SuccessSlcak, SendSlack
sys.excepthook = ExceptSlack.__call__

# Define the next two variables optionally when using OpenAI's API.
# _OPEN_AI_MODEL="gpt-3.5-turbo"    
# _OPEN_AI_API="sk-xxxxxx"
_SLACK_WEBHOOK_URL = 'https://hooks.slack.com/services/xxxxxxxxxxxxxxxxxxx'

try:
    print(1/0)  
    SuccessSlcak().__call__() #1 success sender          
except ExceptSlack as e:      #2 except sender            
    sys.exit()

SendSlack().__call__()        #3 customized sender     
```
<Br>

## 2-6. *Line Notifier*
- a. Register [https://notify-bot.line.me/](https://notify-bot.line.me/)
- b. Go to mypage [https://notify-bot.line.me/my/](https://notify-bot.line.me/my/)
- c. Click `Generate Token`, enter Service Name and click `1-on-1 chat with LINE` (anything you like)
- d. Copy Token.

```python
import sys
from ExceptNotifier import ExceptLine, SuccessLine, SendLine
sys.excepthook = ExceptLine.__call__

# Define the next two variables optionally when using OpenAI's API.
# _OPEN_AI_MODEL="gpt-3.5-turbo"    
# _OPEN_AI_API="sk-xxxxxx"
_LINE_NOTIFY_API_TOKEN = 'xxxxxxxxxxx'

try:
    print(1/20)  
    SuccessLine().__call__() #1 success sender          
except ExceptLine as e:      #2 except sender            
    sys.exit()

SendLine().__call__()        #3 customized sender          
```

<Br>

## 2-7. *SMS Notifier*
- a. Sign up for Twilio. [https://www.twilio.com/en-us](https://www.twilio.com/en-us)
- b. Click Console in the upper right corner.
- c. Copy the variables provided in the console.

```python
import sys
from ExceptNotifier import ExceptSMS, SuccessSMS, SendSMS
sys.excepthook = ExceptSMS.__call__

# Define the next two variables optionally when using OpenAI's API.
# _OPEN_AI_MODEL="gpt-3.5-turbo"    
# _OPEN_AI_API="sk-xxxxxx"
_TWILIO_SID = 'xxxx'
_TWILIO_TOKEN = 'yyyyyy'
_RECIPIENT_PHONE_NUMBER="+aaaaaa",
_SENDER_PHONE_NUMBER="+bbbbbb",  

try:
    print(1/10)  
    SuccessSMS().__call__() #1 success sender          
except ExceptSMS as e:      #2 except sender
    sys.exit()

SendSMS().__call__()        #3 customized sender        
```
<Br>

## 2-8. *Teams Notifier*
- a. Create the channel that you want to notify.
- b. App - Search: webhook - Incoming Webhook [https://teams.microsoft.com/l/app/203a1e2c-26cc-47ca-83ae-be98f960b6b2?source=app-details-dialog](https://teams.microsoft.com/l/app/203a1e2c-26cc-47ca-83ae-be98f960b6b2?source=app-details-dialog)
- c. Click `Request Approval` <br>
After you can use webhook incomming. Proceed to next steps.
Microsoft Teams allows limited application access per organization, so it can only be used if the webhook incoming application is available.
- c. Go to the team channel to receive notifications, and click `Connectors` in Settings.
- d. `Connectors` After configuring webhook incoming in Connector, copy the webhook URL.

```python
import sys
from ExceptNotifier import ExceptTeams, SuccessTeams, SendTeams
sys.excepthook = ExceptTeams.__call__

# Define the next two variables optionally when using OpenAI's API.
# _OPEN_AI_MODEL="gpt-3.5-turbo"    
# _OPEN_AI_API="sk-xxxxxx"
_TEAMS_WEBHOOK_URL = 'microsoft webhook _TEAMS_WEBHOOK_URL'

try:
    print(1/20)  
    SuccessTeams().__call__() #1 success sender          
except ExceptTeams as e:      #2 except sender            
    sys.exit()

SendTeams().__call__()        #3 customized sender        
```

<Br>

## 2-9. *Kakaotalk Notifier*
- a. Sign up at the following site: [https://developers.kakao.com/](https://developers.kakao.com/)
- b. Click "My Application" on the top bar.
- c. Click "Add an application," set a name, and create it.
- d. Click "Kakao Login" in the left menu, then change the State of "Kakao Login Activation" to ON on the resulting page.
- e. In My Application > Product Settings > Kakao Login, be sure to set Redirect URI as follows: [https://example.com/oauth](https://example.com/oauth)
- f. In the left Consent Items menu, set "Send message in KakaoTalk" to selective agreement.
- g. Copy the REST API Key in My Application > App Settings > Summary, and go to the following document.
- h. If you have successfully completed all of the above steps, go to the following document and follow the instructions:
 https://github.com/dsdanielpark/ExceptNotifier/blob/main/tutorials/kakao_token_generator.ipynb
 **In this example, some API keys were exposed by creating and removing a test application, but for security reasons, your API key should not be exposed to the outside world.**
<Br>

```python
import sys
from ExceptNotifier import ExceptKakao, SuccessKakao, SendKakao
sys.excepthook = ExceptKakao.__call__

# Define the next two variables optionally when using OpenAI's API.
# _OPEN_AI_MODEL="gpt-3.5-turbo"    
# _OPEN_AI_API="sk-xxxxxx"
_KAKAO_TOKEN_PATH = 'xxxx/xxx/xxx.json''

try:
    print(1/0)  
    SuccessKakao().__call__() #1 success sender          
except ExceptKakao as e:      #2 except sender            
    sys.exit()

SendKakao().__call__()        #3 customized sender         
```

<Br>

## 2-10. *Beep Notifier*
No setup is required. Use as follows.

```python
from Exceptnotifier import ExceptBeep, SuccessBeep, SendBeep(), beep()
BEEP_TIME = 1
sys.excepthook = ExceptBeep.__call__

try:
    print(1/20)  
    SuccessBeep().__call__() #1 success beep-beep          

except ExceptBeep as e:      #2 except beep-beep                
    sys.exit()

SendBeep().__call__()        #3 customized beep-beep      

beep()

```

<Br>


## 2-11. *Desktop Notifier*
No setup is required. Use as follows.

```python
from ExceptNotifier import ExceptDesktop, SuccessDesktop, SendDesktop
sys.excepthook = ExceptDesktop.__call__
# Define the next two variables optionally when using OpenAI's API.
# _OPEN_AI_MODEL="gpt-3.5-turbo"    
# _OPEN_AI_API="sk-xxxxxx"

try:
    print(1/0)  
    SuccessDesktop().__call__() #1 success sender          

except ExceptDesktop as e:      #2 except sender            
    sys.exit()

SendDesktop().__call__()        #3 customized sender         
```

<Br><br><br>

# License
MIT

# Code of Conduct
Everyone participating in the `ExceptNotifier` project, and in particular in the issue tracker, pull requests, and social media activity, is expected to treat other people with respect and more generally to follow the guidelines articulated in [the Python Community Code of Conduct](https://www.python.org/psf/conduct/).

##### The package is currently in the development and QA stages, and the development stage will be updated at the top of this page. If it is determined that the product is stable through feature improvement, addition, and issue resolution, the development stage will reach stage 5. If no new updates or issues arise, it will be adjusted upward to stage 6 or higher.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dsdanielpark/ExceptNotifier",
    "name": "ExceptNotifier",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "Exception,Python,Python Exception Alarm,Error notifications,Customizable notifications,Traceback management,Single line alarm",
    "author": "daniel park",
    "author_email": "parkminwoo1991@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/09/07/f649c46686fa60fd7a1751c54e7c4b5c6ba487294c68e1ccf5cf7559ee0b/ExceptNotifier-0.1.7.tar.gz",
    "platform": null,
    "description": "Development Status :: 3 - Alpha <br>\r\n*Copyright (c) 2023 MinWoo Park, South Korea*\r\n<br>\r\n![](https://github.com/dsdanielpark/ExceptNotifier/blob/main/assets/imgs/ExceptNotifier_logo.png)\r\n\r\n<h3 align=\"center\">Integrates AI-assisted debugging notifications into Python try-except statements for various messaging applications. </h3>\r\n\r\n<p align=\"center\">\r\n<a href=\"(https://img.shields.io/badge/pypi-ExceptNotifier-orange\"></a>\r\n<a href=\"https://pypi.org/project/exceptnotifier/\"><img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/exceptnotifier\"></a>\r\n<a href=\"https://pepy.tech/project/exceptnotifier\"><img alt=\"Downloads\" src=\"https://pepy.tech/badge/exceptnotifier\"></a>\r\n<a href=\"https://anaconda.org/conda-forge/exceptnotifier/\"><img alt=\"conda-forge\" src=\"https://img.shields.io/conda/dn/conda-forge/exceptnotifier.svg?label=conda-forge\"></a>\r\n<a href=\"https://github.com/psf/black\"><img alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"></a>\r\n</p>\r\n\r\n![](https://github.com/dsdanielpark/ExceptNotifier/blob/main/assets/imgs/main2.png)\r\n\r\n# Python Package: ExceptNotifier\r\n##### Provides a notification from the application shown in the captured screen.\r\n 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.\r\n<Br><br>\r\nWith `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.\r\n\r\n<Br>\r\n\r\n#### Could you kindly add this badge to your repository?\r\n\r\n```\r\n![Except-Notifier](https://img.shields.io/badge/pypi-ExceptNotifier-orange)\r\n```\r\n\r\n\r\n<br><br>\r\n\r\n### Supporting Applications\r\n\r\n- [Telegram](https://telegram.org/)\r\n- [Discord](https://discord.com/)\r\n- [Slack](https://slack.com/)\r\n- [Google Mail](https://mail.google.com/)\r\n- [Line](https://line.me/en/)\r\n- [AWS Chime](https://aws.amazon.com/ko/chime/download-chime/)\r\n- [Microsoft Teams](https://www.microsoft.com/en/microsoft-teams/download-app)\r\n- [Kakao Talk](https://www.kakaocorp.com/page/service/service/KakaoTalk?lang=en)\r\n- SMS Sending using [Twilio](https://www.twilio.com/en-us)\r\n- Desktop Notification using [Plyer](https://github.com/kivy/plyer)\r\n- Beep Sound from [system](https://docs.python.org/3/library/winsound.html)\r\n\r\n<Br>\r\n\r\n### AI Debugging using OpenAI API\r\nIf you have OpenAI API Key and model name, you can get information and code examples for debugging in any application.\r\n- [OPEN AI API](https://platform.openai.com/docs/introduction)\r\n\r\n\r\n<br><br>\r\n\r\n# Quick Start\r\n```bash\r\npip install ExceptNotifier\r\npip install exceptnotifier\r\n\r\nconda install ExceptNotifier\r\nconda install exceptnotifier\r\n```\r\n\r\n<br>\r\n\r\n\r\n# App Setup Overview\r\n\r\n- The variables in the following table must not be contaminated.\r\n- Depending on the situation, consider designating them as global variables for use.\r\n- If you are using Telegram, an example is attached as an image.\r\n- 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.\r\n\r\n| App | Required Variables | Free or Paid | Ease of Setup | Time Required for Setup|Guide Tutorial Link|\r\n|:--:|:--|:--:|:--:|:--:|:---:|\r\n|Beep|N/A|Free|N/A|0 min|[ExceptBeep](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptBeep/GUIDE.md)|\r\n|Desktop|N/A|Free|N/A|0 min|[ExceptDesktop](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptDesktop/GUIDE.md)|\r\n|Telegram|`_TELEGRAM_TOKEN`|Freemium|Easy|2min|[ExceptTelegram](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptTelegram/GUIDE.md)|\r\n|Discord|`_DISCORD_WEBHOOK_URL`|Freemium|Easy|1min|[ExceptDiscord](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptTelegram/GUIDE.md)|\r\n|AWS Chime|`_CHIME_WEBHOOK_URL`|Freemium|Easy|1min|[ExceptChime](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptChime/GUIDE.md)|\r\n|Slack|`_SLACK_WEBHOOK_URL`|Freemium|Easy|3min|[ExceptSlack](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptSlack/GUIDE.md)|\r\n|G-Mail|`_GAMIL_RECIPIENT_ADDR`, `_GMAIL_SENDER_ADDR`, `_GMAIL_APP_PASSWORD_OF_SENDER` |Restricted free|Medium|3min|[ExceptMail](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptMail/GUIDE.md)|\r\n|Line|`_LINE_NOTIFY_API_TOKEN`|Freemium|Medium|4min|[ExceptLine](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptLine/GUIDE.md)|\r\n|SMS|`_TWILIO_SID`, `_TWILIO_TOKEN`, `_RECIPIENT_PHONE_NUMBER`, `_SENDER_PHONE_NUMBER`|Not free|Medium|5min|[ExceptSMS](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptSMS/GUIDE.md)|\r\n|Microsoft Teams|`_TEAMS_WEBHOOK_URL`|Not Free|Medium|5min|[ExceptTeams](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptTeams/GUIDE.md)|\r\n|KakaoTalk|`_KAKAO_TOKEN_PATH`|Freemium|Hell|>=10min(Token refreshes daily)|[ExceptKakao](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/ExceptKakao/GUIDE.md)|\r\n\r\n\r\nIf 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\r\n\r\n| API | Required Variables | Free or Paid | Ease of Setup | Time Required for Setup|Guide Tutorial Link|\r\n|:--:|:--|:--:|:--:|:--:|:---:|\r\n| OpenAI API |`Required variables for each application`+ `_OPEN_AI_MODEL`,`_OPEN_AI_API`|Not free|Easy|2min|[APIOpenAI](https://github.com/dsdanielpark/ExceptNotifier/blob/main/documents/APIOpenAI/GUIDE.md)|\r\n\r\n\r\n<br><br>\r\n\r\n# 1. Key Features\r\nTo use the desired application, you must define the necessary variables. Ensure that the variable names remain unchanged, and you can use either local or global variables. If you are using `Telegram`, an example is attached as an image.\r\n\r\n## 1-1. Except`[appName]`\r\nIf you use Python's try except statement as it is, but change except as follows, you can receive notifications through your application.\r\n```\r\nExceptChime, ExceptTelegram, ExceptDiscord, ExceptSMS, ExceptMail, ExceptKakao, ExceptLine, ExceptSlack, ExceptTeams, ExceptDesktope, ExceptBeep\r\n```\r\n\r\n*Example*\r\n```python\r\nfrom ExceptNotifier import ExceptTelgeram\r\n_TELEGRAM_TOKEN = \"xxxx\"\r\n\r\ntry:\r\n    print(1/0)\r\nexcept ExceptTelegram:    # sending except message to telegram\r\n    sys.exit()\r\n```\r\n![](https://github.com/dsdanielpark/ExceptNotifier/blob/main/assets/imgs/ex1.png)\r\n\r\n<br>\r\n\r\n## 1-2. AI Debbugging Infomation Notification\r\nYou can receive debugging information from ChatGPT via OpenAI's API when using the Except statement. The syntax remains the same, but you'll need to configure these two variables:\r\n`_OPEN_AI_MODEL`,`_OPEN_AI_API`\r\n\r\n*Example*\r\n```python\r\nfrom ExceptNotifier import ExceptTelgeram\r\n_TELEGRAM_TOKEN = \"xxxx\"\r\n_OPEN_AI_MODEL=\"gpt-3.5-turbo\"\r\n_OPEN_AI_API=\"sk-xxxxxx\"\r\n\r\ntry:\r\n    print(1/0)\r\nexcept ExceptTelegram: # sending msg WITH AI DEBUGGING to telegram\r\n    sys.exit()\r\n```\r\n\r\n![](https://github.com/dsdanielpark/ExceptNotifier/blob/main/assets/imgs/ex2.png)\r\n\r\n<br>\r\n\r\n## 1-3. Success`[appName]`\r\nBy placing the try except in python at the end of the try statement, applications can be notified that the try statement worked normally.\r\n```\r\nSuccessChime, SuccessTelegram, SuccessDiscord, SuccessSMS, SuccessMail, SuccessKakao, SuccessLine, SuccessSlack, SuccessTeams, SuccessDesktope, SuccessBeep\r\n```\r\n*Example*\r\n\r\n```python\r\nfrom ExceptNotifier import SuccessTelgeram\r\n_TELEGRAM_TOKEN = \"xxxx\"\r\n\r\ntry:\r\n    print(1/20)\r\n    SuccessTelgeram().__call__()  # sending success message to telegram\r\nexcept:\r\n    sys.exit()\r\n```\r\n\r\n![](https://github.com/dsdanielpark/ExceptNotifier/blob/main/assets/imgs/ex3.png)\r\n\r\n<Br>\r\n\r\n## 1-4. Send`[appName]`\r\nPlace it anywhere on the line of code you want, and you'll be notified when that line of code is reached.\r\n```\r\nSendChime, SendTelegram, SendDiscord, SendSMS, SendMail, SendKakao, SendLine, SendSlack, SendTeams, SendDesktope, SendBeep\r\n```\r\n*Example*\r\n\r\n```python\r\nfrom ExceptNotifier import SendTelgeram\r\n_TELEGRAM_TOKEN = \"xxxx\"\r\n\r\nSendTelegram().__call__() # sending message to telegram\r\n\r\nnoti = SendTelegram()\r\nnoti()                    # sending message to telegram\r\n```\r\n\r\n![](https://github.com/dsdanielpark/ExceptNotifier/blob/main/assets/imgs/ex4.png)\r\n\r\n\r\n<br><br>\r\n\r\n# 2. Features\r\nYou can receive debugging information from ChatGPT via OpenAI's API when using the Except statement. The syntax remains the same, but you'll need to configure these two variables:\r\n`_OPEN_AI_MODEL`,`_OPEN_AI_API`\r\n\r\n\r\n\r\n## 2-1. *Telegram Notifier*\r\n\r\n- a. Open your telegram app and search for BotFather. (A built-in Telegram bot that helps users create custom Telegram bots) <br>\r\n- b. Type /newbot to create a new bot <br>\r\n- c. Give your bot a name & a username <br>\r\n- d. Copy your new Telegram bot\u2019s token <br>\r\n\r\nFor more infomation, visit [Telegram Bot Father API](https://core.telegram.org/bots/api)\r\n<br><br>\r\n \r\n### a. Without OpenAI API\r\n\r\n```python\r\nfrom ExceptNotifier import ExceptTelegram, SuccessTelegram, SendTelegram\r\nimport sys\r\nsys.excepthook = ExceptTelegram.__call__\r\n\r\n_TELEGRAM_TOKEN = \"xxxx\"\r\n\r\ntry:\r\n    print(1/0)  \r\n    SuccessTelegram().__call__() #1. success sender          \r\n\r\nexcept ExceptTelegram as e:      #2. except sender            \r\n    sys.exit()\r\n\r\nSendTelegram().__call__()        #3. customized sender     \r\n```\r\n\r\n\r\n![](https://github.com/dsdanielpark/ExceptNotifier/blob/main/assets/imgs/fig44.png)\r\n\r\n\r\n### b. With OpenAI API\r\n```python\r\nfrom ExceptNotifier import ExceptTelegram, SuccessTelegram, SendTelegram\r\nimport sys\r\nsys.excepthook = ExceptTelegram.__call__\r\n\r\n_TELEGRAM_TOKEN = \"xxxx\"\r\n_OPEN_AI_MODEL=\"gpt-3.5-turbo\"\r\n_OPEN_AI_API=\"sk-xxxxxx\"\r\n\r\ntry:\r\n    print(1/0)  \r\n    SuccessTelegram().__call__() #1. success sender          \r\n\r\nexcept ExceptTelegram as e:      #2. except sender            \r\n    sys.exit()\r\n\r\nSendTelegram().__call__()        #3. customized sender     \r\n\r\n```\r\n<br>\r\n\r\n## 2-2. *Mail Notifier*\r\nIn the except statement, an email is sent along with the error message. Additionally, you can send emails from any desired line. <br>\r\n- a. Log in with the sender's email ID. <br>\r\n- b. Obtain an app password for sending Google Mail at the following [link](https://myaccount.google.com/u/3/apppasswords?utm_source=google-account&utm_medium=myaccountsecurity&utm_campaign=tsv-settings&rapt=AEjHL4N2bMRWO46VaMp_jP06zQK14BWNPv66l2o59iJ99CkO8BjYnmoRUe9dtSchkkbubHZMUhevkAnwVJRHb9ygO3afispNlw) or [google document](https://support.google.com/accounts/answer/185833?hl=en). \r\n\r\n```python\r\nimport sys\r\nfrom ExceptNotifier import ExceptMail, SuccessMail, SendMail\r\nsys.excepthook = ExceptMail.__call__\r\n\r\n# Define the next two variables optionally when using OpenAI's API.\r\n# _OPEN_AI_MODEL=\"gpt-3.5-turbo\"    \r\n# _OPEN_AI_API=\"sk-xxxxxx\"\r\n_GAMIL_RECIPIENT_ADDR = 'xxxxxxx@gmail.com'\r\n_GMAIL_SENDER_ADDR = 'yyyyyy@gmail.com'\r\n_GMAIL_APP_PASSWORD_OF_SENDER = 'zzzzzz'\r\n\r\ntry:\r\n    main()                      # Your Code Here\r\n    SuccessMail().__call__()    # No Exception -> Send Success mail.\r\nexcept ExceptMail:              # Exception -> Send Fail mail.\r\n    pass\r\n\r\nSendMail().__call__()           # When Process Ended -> Any Line mail.\r\n```\r\n\r\n<details>\r\n<summary> See Example...</summary>\r\n\r\n```python\r\nimport sys\r\nfrom ExceptNotifier import ExceptMail, SuccessMail, SendMail\r\n\r\n# Define the next two variables optionally when using OpenAI's API.\r\n# _OPEN_AI_MODEL=\"gpt-3.5-turbo\"    \r\n# _OPEN_AI_API=\"sk-xxxxxx\"\r\n_GAMIL_RECIPIENT_ADDR = 'xxxxxxx@gmail.com'\r\n_GMAIL_SENDER_ADDR = 'yyyyyy@gmail.com'\r\n_GMAIL_APP_PASSWORD_OF_SENDER = 'zzzzzz'\r\n\r\nsys.excepthook = ExceptMail.__call__\r\n\r\ntry:\r\n    # 02.Locate your code\r\n    print(1/0)   \r\n    SuccessMail().__call__()   # Success Mail\r\n\r\nexcept ExceptMail as e:        # Exception Mail       \r\n    sys.exit()\r\n    print(e)\r\n\r\nSendMail().__call__()          # Put Any Line: Sending mail\r\n```\r\n</details>\r\n\r\n<details>\r\n<summary> Snippet for Python developers...</summary>\r\n\r\n```python\r\nimport sys\r\nfrom ExceptNotifier import ExceptMail, SuccessMail, SendMail\r\nsys.excepthook = ExceptMail.__call__\r\n\r\n# Define the next two variables optionally when using OpenAI's API.\r\n# _OPEN_AI_MODEL=\"gpt-3.5-turbo\"    \r\n# _OPEN_AI_API=\"sk-xxxxxx\"\r\n_GAMIL_RECIPIENT_ADDR = 'xxxxxxx@gmail.com'\r\n_GMAIL_SENDER_ADDR = 'yyyyyy@gmail.com'\r\n_GMAIL_APP_PASSWORD_OF_SENDER = 'zzzzzz'\r\n\r\ntry:\r\n    'your code'\r\n    SuccessMail().__call__()\r\nexcept ExceptMail:\r\n    pass\r\n\r\nSendMail().__call__() \r\n```\r\n</details>\r\n\r\n<br>\r\n\r\n## 2-3. *Discord Notifier*\r\n- a. Select the channel to receive notifications.\r\n- b. Click \"Edit Channel\" in the upper right corner of the chat window.\r\n- c. Click Integrations - Webhook - New Webhook.\r\n- d. Then click Copy Webhook.\r\n\r\n```python\r\nimport sys\r\nfrom ExceptNotifier import ExceptDiscord, SuccessDiscord, SendDiscord\r\nsys.excepthook = ExceptDiscord.__call__\r\n\r\n# Define the next two variables optionally when using OpenAI's API.\r\n# _OPEN_AI_MODEL=\"gpt-3.5-turbo\"    \r\n# _OPEN_AI_API=\"sk-xxxxxx\"\r\n_DISCORD_WEBHOOK_URL = \"xxxxxxxxxxxxxxxxx\"\r\n\r\n\r\ntry:\r\n    print(1/20)  \r\n    SuccessDiscord().__call__() #1 success sender          \r\nexcept ExceptDiscord as e:      #2 except sender            \r\n    sys.exit()\r\n\r\nSendDiscord().__call__()        #3 customized sender       \r\n```\r\n\r\n<br>\r\n\r\n## 2-4. *Chime Notifier*\r\n- a. Select the Chat room to receive notifications.\r\n- b. Click \"Room Setting\" in the upper right corner.\r\n- c. Click \"Manage Webhook and bot.\"\r\n- d. Create Add Webhook, set it up, then click Copy Webhook.\r\n```python\r\nimport sys\r\nfrom ExceptNotifier import SuccessChime, ExceptChime, SendChime\r\nsys.excepthook = ExceptChime.__call__\r\n\r\n# Define the next two variables optionally when using OpenAI's API.\r\n# _OPEN_AI_MODEL=\"gpt-3.5-turbo\"    \r\n# _OPEN_AI_API=\"sk-xxxxxx\"\r\n_CHIME_WEBHOOK_URL = \"xxxxxxxxxxxxxxxxxx\"\r\n\r\n\r\ntry:\r\n    print(1/0)  \r\n    SuccessChime().__call__() #1 success sender          \r\nexcept ExceptChime as e:      #2 except sender            \r\n    sys.exit()\r\n\r\nSendChime().__call__()        #3 customized sender       \r\n```\r\n<br>\r\n\r\n## 2-5. *Slack Notifier*\r\n- a. visit https://api.slack.com/\r\n- b. `Create an app` - `From scratch` - `Create App`\r\n- c. Add webhook: Click `Incoming Webhooks` - Activate Incomming `On` - Add New Webhook to Workspace\r\n- d. Copy `Webhook URL`\r\n\r\n```python\r\nimport sys\r\nfrom ExceptNotifier import ExceptSlack, SuccessSlcak, SendSlack\r\nsys.excepthook = ExceptSlack.__call__\r\n\r\n# Define the next two variables optionally when using OpenAI's API.\r\n# _OPEN_AI_MODEL=\"gpt-3.5-turbo\"    \r\n# _OPEN_AI_API=\"sk-xxxxxx\"\r\n_SLACK_WEBHOOK_URL = 'https://hooks.slack.com/services/xxxxxxxxxxxxxxxxxxx'\r\n\r\ntry:\r\n    print(1/0)  \r\n    SuccessSlcak().__call__() #1 success sender          \r\nexcept ExceptSlack as e:      #2 except sender            \r\n    sys.exit()\r\n\r\nSendSlack().__call__()        #3 customized sender     \r\n```\r\n<Br>\r\n\r\n## 2-6. *Line Notifier*\r\n- a. Register [https://notify-bot.line.me/](https://notify-bot.line.me/)\r\n- b. Go to mypage [https://notify-bot.line.me/my/](https://notify-bot.line.me/my/)\r\n- c. Click `Generate Token`, enter Service Name and click `1-on-1 chat with LINE` (anything you like)\r\n- d. Copy Token.\r\n\r\n```python\r\nimport sys\r\nfrom ExceptNotifier import ExceptLine, SuccessLine, SendLine\r\nsys.excepthook = ExceptLine.__call__\r\n\r\n# Define the next two variables optionally when using OpenAI's API.\r\n# _OPEN_AI_MODEL=\"gpt-3.5-turbo\"    \r\n# _OPEN_AI_API=\"sk-xxxxxx\"\r\n_LINE_NOTIFY_API_TOKEN = 'xxxxxxxxxxx'\r\n\r\ntry:\r\n    print(1/20)  \r\n    SuccessLine().__call__() #1 success sender          \r\nexcept ExceptLine as e:      #2 except sender            \r\n    sys.exit()\r\n\r\nSendLine().__call__()        #3 customized sender          \r\n```\r\n\r\n<Br>\r\n\r\n## 2-7. *SMS Notifier*\r\n- a. Sign up for Twilio. [https://www.twilio.com/en-us](https://www.twilio.com/en-us)\r\n- b. Click Console in the upper right corner.\r\n- c. Copy the variables provided in the console.\r\n\r\n```python\r\nimport sys\r\nfrom ExceptNotifier import ExceptSMS, SuccessSMS, SendSMS\r\nsys.excepthook = ExceptSMS.__call__\r\n\r\n# Define the next two variables optionally when using OpenAI's API.\r\n# _OPEN_AI_MODEL=\"gpt-3.5-turbo\"    \r\n# _OPEN_AI_API=\"sk-xxxxxx\"\r\n_TWILIO_SID = 'xxxx'\r\n_TWILIO_TOKEN = 'yyyyyy'\r\n_RECIPIENT_PHONE_NUMBER=\"+aaaaaa\",\r\n_SENDER_PHONE_NUMBER=\"+bbbbbb\",  \r\n\r\ntry:\r\n    print(1/10)  \r\n    SuccessSMS().__call__() #1 success sender          \r\nexcept ExceptSMS as e:      #2 except sender\r\n    sys.exit()\r\n\r\nSendSMS().__call__()        #3 customized sender        \r\n```\r\n<Br>\r\n\r\n## 2-8. *Teams Notifier*\r\n- a. Create the channel that you want to notify.\r\n- b. App - Search: webhook - Incoming Webhook [https://teams.microsoft.com/l/app/203a1e2c-26cc-47ca-83ae-be98f960b6b2?source=app-details-dialog](https://teams.microsoft.com/l/app/203a1e2c-26cc-47ca-83ae-be98f960b6b2?source=app-details-dialog)\r\n- c. Click `Request Approval` <br>\r\nAfter you can use webhook incomming. Proceed to next steps.\r\nMicrosoft Teams allows limited application access per organization, so it can only be used if the webhook incoming application is available.\r\n- c. Go to the team channel to receive notifications, and click `Connectors` in Settings.\r\n- d. `Connectors` After configuring webhook incoming in Connector, copy the webhook URL.\r\n\r\n```python\r\nimport sys\r\nfrom ExceptNotifier import ExceptTeams, SuccessTeams, SendTeams\r\nsys.excepthook = ExceptTeams.__call__\r\n\r\n# Define the next two variables optionally when using OpenAI's API.\r\n# _OPEN_AI_MODEL=\"gpt-3.5-turbo\"    \r\n# _OPEN_AI_API=\"sk-xxxxxx\"\r\n_TEAMS_WEBHOOK_URL = 'microsoft webhook _TEAMS_WEBHOOK_URL'\r\n\r\ntry:\r\n    print(1/20)  \r\n    SuccessTeams().__call__() #1 success sender          \r\nexcept ExceptTeams as e:      #2 except sender            \r\n    sys.exit()\r\n\r\nSendTeams().__call__()        #3 customized sender        \r\n```\r\n\r\n<Br>\r\n\r\n## 2-9. *Kakaotalk Notifier*\r\n- a. Sign up at the following site: [https://developers.kakao.com/](https://developers.kakao.com/)\r\n- b. Click \"My Application\" on the top bar.\r\n- c. Click \"Add an application,\" set a name, and create it.\r\n- d. Click \"Kakao Login\" in the left menu, then change the State of \"Kakao Login Activation\" to ON on the resulting page.\r\n- e. In My Application > Product Settings > Kakao Login, be sure to set Redirect URI as follows: [https://example.com/oauth](https://example.com/oauth)\r\n- f. In the left Consent Items menu, set \"Send message in KakaoTalk\" to selective agreement.\r\n- g. Copy the REST API Key in My Application > App Settings > Summary, and go to the following document.\r\n- h. If you have successfully completed all of the above steps, go to the following document and follow the instructions:\r\n https://github.com/dsdanielpark/ExceptNotifier/blob/main/tutorials/kakao_token_generator.ipynb\r\n **In this example, some API keys were exposed by creating and removing a test application, but for security reasons, your API key should not be exposed to the outside world.**\r\n<Br>\r\n\r\n```python\r\nimport sys\r\nfrom ExceptNotifier import ExceptKakao, SuccessKakao, SendKakao\r\nsys.excepthook = ExceptKakao.__call__\r\n\r\n# Define the next two variables optionally when using OpenAI's API.\r\n# _OPEN_AI_MODEL=\"gpt-3.5-turbo\"    \r\n# _OPEN_AI_API=\"sk-xxxxxx\"\r\n_KAKAO_TOKEN_PATH = 'xxxx/xxx/xxx.json''\r\n\r\ntry:\r\n    print(1/0)  \r\n    SuccessKakao().__call__() #1 success sender          \r\nexcept ExceptKakao as e:      #2 except sender            \r\n    sys.exit()\r\n\r\nSendKakao().__call__()        #3 customized sender         \r\n```\r\n\r\n<Br>\r\n\r\n## 2-10. *Beep Notifier*\r\nNo setup is required. Use as follows.\r\n\r\n```python\r\nfrom Exceptnotifier import ExceptBeep, SuccessBeep, SendBeep(), beep()\r\nBEEP_TIME = 1\r\nsys.excepthook = ExceptBeep.__call__\r\n\r\ntry:\r\n    print(1/20)  \r\n    SuccessBeep().__call__() #1 success beep-beep          \r\n\r\nexcept ExceptBeep as e:      #2 except beep-beep                \r\n    sys.exit()\r\n\r\nSendBeep().__call__()        #3 customized beep-beep      \r\n\r\nbeep()\r\n\r\n```\r\n\r\n<Br>\r\n\r\n\r\n## 2-11. *Desktop Notifier*\r\nNo setup is required. Use as follows.\r\n\r\n```python\r\nfrom ExceptNotifier import ExceptDesktop, SuccessDesktop, SendDesktop\r\nsys.excepthook = ExceptDesktop.__call__\r\n# Define the next two variables optionally when using OpenAI's API.\r\n# _OPEN_AI_MODEL=\"gpt-3.5-turbo\"    \r\n# _OPEN_AI_API=\"sk-xxxxxx\"\r\n\r\ntry:\r\n    print(1/0)  \r\n    SuccessDesktop().__call__() #1 success sender          \r\n\r\nexcept ExceptDesktop as e:      #2 except sender            \r\n    sys.exit()\r\n\r\nSendDesktop().__call__()        #3 customized sender         \r\n```\r\n\r\n<Br><br><br>\r\n\r\n# License\r\nMIT\r\n\r\n# Code of Conduct\r\nEveryone participating in the `ExceptNotifier` project, and in particular in the issue tracker, pull requests, and social media activity, is expected to treat other people with respect and more generally to follow the guidelines articulated in [the Python Community Code of Conduct](https://www.python.org/psf/conduct/).\r\n\r\n##### The package is currently in the development and QA stages, and the development stage will be updated at the top of this page. If it is determined that the product is stable through feature improvement, addition, and issue resolution, the development stage will reach stage 5. If no new updates or issues arise, it will be adjusted upward to stage 6 or higher.\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "With Python's try-except to receive notifications about Errors or Successes in your code through messenger app or email.",
    "version": "0.1.7",
    "split_keywords": [
        "exception",
        "python",
        "python exception alarm",
        "error notifications",
        "customizable notifications",
        "traceback management",
        "single line alarm"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f751291ba4f20509ef834722a13edc8ba382e039cb0c8a317a5ca4f1dea01889",
                "md5": "cb200907ded9b7bf9930941b8098bda9",
                "sha256": "1df05409b16be8d0b286b048eed8a1793e6771fa3aa0e79a4ab2af67760df632"
            },
            "downloads": -1,
            "filename": "ExceptNotifier-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cb200907ded9b7bf9930941b8098bda9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 45116,
            "upload_time": "2023-04-19T17:58:58",
            "upload_time_iso_8601": "2023-04-19T17:58:58.082921Z",
            "url": "https://files.pythonhosted.org/packages/f7/51/291ba4f20509ef834722a13edc8ba382e039cb0c8a317a5ca4f1dea01889/ExceptNotifier-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0907f649c46686fa60fd7a1751c54e7c4b5c6ba487294c68e1ccf5cf7559ee0b",
                "md5": "ba5a44ae6d8b32d84f100d930576d20b",
                "sha256": "94a4097a0257e45a3c08abaae339426de24c7fc1adb35be452c1663a3f9f2edf"
            },
            "downloads": -1,
            "filename": "ExceptNotifier-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "ba5a44ae6d8b32d84f100d930576d20b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 27073,
            "upload_time": "2023-04-19T17:59:06",
            "upload_time_iso_8601": "2023-04-19T17:59:06.099766Z",
            "url": "https://files.pythonhosted.org/packages/09/07/f649c46686fa60fd7a1751c54e7c4b5c6ba487294c68e1ccf5cf7559ee0b/ExceptNotifier-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-19 17:59:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "dsdanielpark",
    "github_project": "ExceptNotifier",
    "lcname": "exceptnotifier"
}
        
Elapsed time: 0.73383s