# Clone & Install
pip install git+https://github.com/lx200916/exception_notify
# or
git clone https://github.com/lx200916/exception_notify &&cd exception_notify
pip install -e .
- Feishu(Lark)
-
Provide Config.
Two ways:
- Store Config in
~/.exception_notify.toml
.
- Store Config in
Config Example:
[feishu] webhook = "https://open.feishu.cn/open-apis/bot/v2/hook/xxx" # pre_str = "Notify ⚠️" # Optional # at = ["MY_FEISHU_OPEN_ID"] # Optional
- Or Pass the config dict in
install
function.
- Import the Lib in the Script then
install()
. - (Optional) Add Additional Info to the Notification Message Body.
- Call
ExceptionNotify.add_info({"key":"value"})
to add additional info.(for example:Model Best Acc.
,HyperParameter
).
- Call
- (Optional) Setup Done Notify.
Two Ways:
- Call
Done()
Manually when the script is done. - Pass
register_done_handler=True
ininstall()
function, then you will get notified when the script is done.
- (Optional) Manually Send Any Text Message. Call
ExceptionNotify.send_message("Message")
to send message.
Code Example:
import ExceptionNotify
ExceptionNotify.install(register_done_handler=True)
do_awsome_things()
ExceptionNotify.update_info({"Best Acc.":0.99})
# Get Notified when the script is done.