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_NOTIFY_API_TOKEN: str, msg: str) dict
Send message to chat room through Line app’s REST API.
- Parameters:
_LINE_NOTIFY_API_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_ADDR: str, _GAMIL_RECIPIENT_ADDR: str, _GMAIL_APP_PASSWORD_OF_SENDER: str, subject_msg: str, body_msg: str) dict
Send mail through gmail smtp server
- Parameters:
_GMAIL_SENDER_ADDR (str) – Gmail address who send message
_GAMIL_RECIPIENT_ADDR (str) – Gmail address who receive message
_GMAIL_APP_PASSWORD_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(_OPEN_AI_MODEL: str, _OPEN_AI_API: str, error_message: str) dict
Check response of Open AI API status
- Parameters:
_OPEN_AI_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(_OPEN_AI_MODEL: str, _OPEN_AI_API: str, error_message: str) str
Receive debugging information about your code from models in open ai.
- Parameters:
_OPEN_AI_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(_OPEN_AI_MODEL: str, _OPEN_AI_API: str, error_message: str) dict
Check response of Open AI API status
- Parameters:
_OPEN_AI_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(_OPEN_AI_MODEL: str, _OPEN_AI_API: str, error_message: str) str
Receive debugging information about your code from models in open ai.
- Parameters:
_OPEN_AI_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_ADDR: str, _GAMIL_RECIPIENT_ADDR: str, _GMAIL_APP_PASSWORD_OF_SENDER: str, subject_msg: str, body_msg: str) dict
Send mail through gmail smtp server
- Parameters:
_GMAIL_SENDER_ADDR (str) – Gmail address who send message
_GAMIL_RECIPIENT_ADDR (str) – Gmail address who receive message
_GMAIL_APP_PASSWORD_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_NOTIFY_API_TOKEN: str, msg: str) dict
Send message to chat room through Line app’s REST API.
- Parameters:
_LINE_NOTIFY_API_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