ExceptNotifier.base package
Submodules
ExceptNotifier.base.beep_sender module
- ExceptNotifier.base.beep_sender.beep(sec=1, freq=1000) None
Make beep sound
- Parameters:
sec (int, optional) – Beep duration, defaults to 1
freq (int, optional) – Beep fequency, defaults to 1000
ExceptNotifier.base.chime_sender module
- ExceptNotifier.base.chime_sender.send_chime_msg(chime_webhook_url: str, msg: str) dict
Send message to chat room through chime app’s webhook url.
- Parameters:
chime_webhook_url (str) – Webhook url from chime app
msg (str) – Message text
- Returns:
Response according to REST API request
- Return type:
dict
ExceptNotifier.base.desktop_sender module
- ExceptNotifier.base.desktop_sender.send_desktop_msg(title_msg: str, body_msg: str, DISP_TIME=5) None
Sending notification to desktop
- Parameters:
title_msg (str) – Title of message
body_msg (str) – Body of message
DISP_TIME (int, optional) – Time duration, defaults to 5
ExceptNotifier.base.discord_sender module
- ExceptNotifier.base.discord_sender.send_discord_msg(discord_webhook_url: str, msg: str) dict
Send message to chat room through discord app’s webhook url.
- Parameters:
discord_webhook_url (str) – Webhook url from discord app
msg (str) – Message text
- Returns:
Response according to REST API request
- Return type:
dict
ExceptNotifier.base.kakao_sender module
- ExceptNotifier.base.kakao_sender.send_kakao_msg(kakao_token_path: str, msg: str) dict
Send message to chat room through kakaotalk app’s REST API.
- Parameters:
kakao_token_path (str) – Kakaotalk token path
msg (str) – Message text
- Returns:
Response according to REST API request
- Return type:
dict
ExceptNotifier.base.line_sender module
- ExceptNotifier.base.line_sender.send_line_msg(line_token: str, msg: str) dict
Send message to chat room through Line app’s REST API.
- Parameters:
line_token (str) – Line notify API token
msg (str) – Message text
- Returns:
Response according to REST API request
- Return type:
dict
ExceptNotifier.base.mail_sender module
- ExceptNotifier.base.mail_sender.send_gmail_msg(gmail_sender_address: str, gmail_recipient_address: str, gamil_app_pw_of_sender: str, subject_msg: str, body_msg: str) dict
Send mail through gmail smtp server
- Parameters:
gmail_sender_address (str) – Gmail address who send message
gmail_recipient_address (str) – Gmail address who receive message
gamil_app_pw_of_sender (str) – Google app password
subject_msg (str) – Mail title
body_msg (str) – Mail body
- Returns:
Response according to sending request
- Return type:
dict
ExceptNotifier.base.openai_receiver module
- ExceptNotifier.base.openai_receiver.get_resp_openai_advice(openai_model: str, open_ai_api: str, error_message: str) dict
Check response of Open AI API status
- Parameters:
openai_model (str) – model name of open ai
open_ai_api (str) – API KEY value of open ai
error_message (str) – Error message
- Returns:
Returns response dict to openai
- Return type:
dict
- ExceptNotifier.base.openai_receiver.receive_openai_advice(openai_model: str, open_ai_api: str, error_message: str) str
Receive debugging information about your code from models in open ai.
- Parameters:
openai_model (str) – model name of open ai
open_ai_api (str) – API KEY value of open ai
error_message (str) – Error message
- Returns:
Returns a description and example of the code, the location of the error, and a debugging code example.
- Return type:
str
ExceptNotifier.base.slack_sender module
- ExceptNotifier.base.slack_sender.send_slack_msg(slack_webhook_url: str, msg: str) dict
Send message to chat room through slack app’s api.
- Parameters:
slack_webhook_url (str) – slack_webhook_url from slack app
msg (str) – Message text
- Returns:
Response according to REST API request
- Return type:
dict
ExceptNotifier.base.sms_sender module
- ExceptNotifier.base.sms_sender.send_sms_msg(twilio_sid: str, twilio_token: str, sender_phone_number: str, recipient_phone_number: str, msg: str) dict
Send SMS through twilio platform. https://www.twilio.com/en-us
- Parameters:
twilio_sid (str) – Twilio personal twilio_sid
twilio_token (str) – Twilio personal twilio_token
sender_phone_number (str) – Sender phone number
recipient_phone_number (str) – Recipient phone number
msg (str) – SMS content
- Returns:
Response dict
- Return type:
dict
ExceptNotifier.base.teams_sender module
- ExceptNotifier.base.teams_sender.send_teams_msg(teams_webhook_url, msg)
Send message to chat room through microsoft teams app’s webhook url.
- Parameters:
teams_webhook_url (str) – teams_webhook_url from teams app
msg (str) – Message text
- Returns:
Response according to REST API request
- Return type:
dict
ExceptNotifier.base.telegram_sender module
- ExceptNotifier.base.telegram_sender.send_telegram_msg(telegram_token: str, msg: str) dict
Send message via telegram bot.
- Parameters:
telegram_token (str) – Telegram secure bot Token
msg (str) – Message content
- Returns:
Response dict
- Return type:
dict
ExceptNotifier.base.wechat_sender module
- ExceptNotifier.base.wechat_sender.send_wechat_msg(wechat_webhook_url: str, msg: str) None
Send message to wechat.
- Parameters:
wechat_webhook_url (str) – Wechat Webhook URL https://work.weixin.qq.com/api/doc/90000/90136/91770
msg (str) – Message to send
ExceptNotifier.base.whatsapp_sender module
- ExceptNotifier.base.whatsapp_sender.send_whatsapp_msg(msg: str, sender_phone_number_id: str, TOKEN: str, receiver_number: str, recipient_type: str = 'individual') dict
Send me a message via whatsapp. However, from v16 api, it seems to have been changed so that templates that have passed deliberation can be sent. Therefore, it is NOT used by ExceptNotifier.
- Parameters:
msg (str) – Message content (Cannot be used as it is not a template)
sender_phone_number_id (str) – Sender phone number
TOKEN (str) – Whatsapp personal token
receiver_number (str) – Recipient phone number
recipient_type (str, optional) – Type of recipient, defaults to “individual”
- Returns:
_description_
- Return type:
dict
Module contents
- ExceptNotifier.base.beep(sec=1, freq=1000) None
Make beep sound
- Parameters:
sec (int, optional) – Beep duration, defaults to 1
freq (int, optional) – Beep fequency, defaults to 1000
- ExceptNotifier.base.get_resp_openai_advice(openai_model: str, open_ai_api: str, error_message: str) dict
Check response of Open AI API status
- Parameters:
openai_model (str) – model name of open ai
open_ai_api (str) – API KEY value of open ai
error_message (str) – Error message
- Returns:
Returns response dict to openai
- Return type:
dict
- ExceptNotifier.base.receive_openai_advice(openai_model: str, open_ai_api: str, error_message: str) str
Receive debugging information about your code from models in open ai.
- Parameters:
openai_model (str) – model name of open ai
open_ai_api (str) – API KEY value of open ai
error_message (str) – Error message
- Returns:
Returns a description and example of the code, the location of the error, and a debugging code example.
- Return type:
str
- ExceptNotifier.base.send_chime_msg(chime_webhook_url: str, msg: str) dict
Send message to chat room through chime app’s webhook url.
- Parameters:
chime_webhook_url (str) – Webhook url from chime app
msg (str) – Message text
- Returns:
Response according to REST API request
- Return type:
dict
- ExceptNotifier.base.send_discord_msg(discord_webhook_url: str, msg: str) dict
Send message to chat room through discord app’s webhook url.
- Parameters:
discord_webhook_url (str) – Webhook url from discord app
msg (str) – Message text
- Returns:
Response according to REST API request
- Return type:
dict
- ExceptNotifier.base.send_gmail_msg(gmail_sender_address: str, gmail_recipient_address: str, gamil_app_pw_of_sender: str, subject_msg: str, body_msg: str) dict
Send mail through gmail smtp server
- Parameters:
gmail_sender_address (str) – Gmail address who send message
gmail_recipient_address (str) – Gmail address who receive message
gamil_app_pw_of_sender (str) – Google app password
subject_msg (str) – Mail title
body_msg (str) – Mail body
- Returns:
Response according to sending request
- Return type:
dict
- ExceptNotifier.base.send_kakao_msg(kakao_token_path: str, msg: str) dict
Send message to chat room through kakaotalk app’s REST API.
- Parameters:
kakao_token_path (str) – Kakaotalk token path
msg (str) – Message text
- Returns:
Response according to REST API request
- Return type:
dict
- ExceptNotifier.base.send_line_msg(line_token: str, msg: str) dict
Send message to chat room through Line app’s REST API.
- Parameters:
line_token (str) – Line notify API token
msg (str) – Message text
- Returns:
Response according to REST API request
- Return type:
dict
- ExceptNotifier.base.send_slack_msg(slack_webhook_url: str, msg: str) dict
Send message to chat room through slack app’s api.
- Parameters:
slack_webhook_url (str) – slack_webhook_url from slack app
msg (str) – Message text
- Returns:
Response according to REST API request
- Return type:
dict
- ExceptNotifier.base.send_sms_msg(twilio_sid: str, twilio_token: str, sender_phone_number: str, recipient_phone_number: str, msg: str) dict
Send SMS through twilio platform. https://www.twilio.com/en-us
- Parameters:
twilio_sid (str) – Twilio personal twilio_sid
twilio_token (str) – Twilio personal twilio_token
sender_phone_number (str) – Sender phone number
recipient_phone_number (str) – Recipient phone number
msg (str) – SMS content
- Returns:
Response dict
- Return type:
dict
- ExceptNotifier.base.send_teams_msg(teams_webhook_url, msg)
Send message to chat room through microsoft teams app’s webhook url.
- Parameters:
teams_webhook_url (str) – teams_webhook_url from teams app
msg (str) – Message text
- Returns:
Response according to REST API request
- Return type:
dict
- ExceptNotifier.base.send_telegram_msg(telegram_token: str, msg: str) dict
Send message via telegram bot.
- Parameters:
telegram_token (str) – Telegram secure bot Token
msg (str) – Message content
- Returns:
Response dict
- Return type:
dict
- ExceptNotifier.base.send_wechat_msg(wechat_webhook_url: str, msg: str) None
Send message to wechat.
- Parameters:
wechat_webhook_url (str) – Wechat Webhook URL https://work.weixin.qq.com/api/doc/90000/90136/91770
msg (str) – Message to send
- ExceptNotifier.base.send_whatsapp_msg(msg: str, sender_phone_number_id: str, TOKEN: str, receiver_number: str, recipient_type: str = 'individual') dict
Send me a message via whatsapp. However, from v16 api, it seems to have been changed so that templates that have passed deliberation can be sent. Therefore, it is NOT used by ExceptNotifier.
- Parameters:
msg (str) – Message content (Cannot be used as it is not a template)
sender_phone_number_id (str) – Sender phone number
TOKEN (str) – Whatsapp personal token
receiver_number (str) – Recipient phone number
recipient_type (str, optional) – Type of recipient, defaults to “individual”
- Returns:
_description_
- Return type:
dict