A detailed blog post explaining how to set up and use a Telegram bot can be read here: https://sola.kau.se/deprimap/2025/07/16/telegram-bot/
This repository shows you how to receive Telegram messages when your Jupyter Notebook finishes running a cell or task.
No more constantly checking your screen β get notified instantly, whether you're training a model, processing geospatial data, or running a long Earth Engine export.
- How to create a Telegram bot using
@BotFather - How to find your Telegram chat ID
- How to write a Python function that sends messages via your bot
- How to use this in a real Jupyter Notebook workflow
| File | Description |
|---|---|
telegram_notify_example.ipynb |
A step-by-step notebook with all the code and setup instructions |
requirements.txt |
Python dependencies (just requests) |
pip install requests- Open Telegram and start a chat with
@BotFather - Type
/newbotand follow instructions to create your bot - Copy the API token that
@BotFathergives you
-
Search for your bot in Telegram and click 'Start'. Send a 'Hi' message.
-
Open the following URL in a browser (replace with your token):
https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates -
You'll see a response containing
"chat": { "id": 123456789 }- this is your chat ID.
- Open
telegram_notify_example.ipynb - Replace
PASTE_YOUR_BOT_TOKEN_HEREandPASTE_YOUR_CHAT_ID_HEREwith your values - Run the cells and see the magic β¨
- Model training that takes hours
- Huge reprojections or export tasks
- Heavy geospatial joins/data downloads
- Notebooks running on remote servers
- Any task where you don't want to keep checking progress manually
- This bot can only send messages to you, no access to files or data
- Do not share your token publicly
- If needed, you can regenerate the token anytime using
@BotFather
Developed by Sai Ganesh Veeravalli, part of the DEPRIMAP Project at Karlstad University (https://sola.kau.se/deprimap/)