A simple python library that sends you a message on your preferred channel when your code finished running or encountered an error.
To set up Toaster, simply follow the installation and usage example.
This is an example of how to list things you need to use the software and how to install them.
- Preferred notification channel (Telegram account/Slack Webhook URL)
- Python 3
- Install via pip
pip install pytoaster
from toaster import telegram_toast, slack_toast, set_config
# for telegram notification
set_config(config_str=<your_telegram_id>, notification_channel='telegram')
# for slack notification
set_config(config_str=<incoming_webhook>, notification_channel='slack')
Note: You'll only have to do this once, it'll then be saved to config.json
in toaster's installation path.
# telegram example
@telegram_toast
def test_func(a,b):
time.sleep(5)
return 'Return {} and {}'.format(str(a),str(b))
# slack example
@slack_toast
def test_func(a,b):
time.sleep(5)
return 'Return {} and {}'.format(str(a),str(b))
Step 3. You'll be notified by according to your preferred channel when your code finishes executing.
- Telegram Example: Notification by @FreshToasterBot
Get your telegram ID from @FreshToasterBot on Telegram
Follow the official instructions from Slack
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
- Gal Shir for his cute toaster design https://galshir.com/
- Yuval for his contribution to integrating slack https://github.com/GuitaristForEver