Skip to content

πŸ“¬ Get Telegram messages when your Jupyter Notebook finishes running. A simple, secure, and useful setup for long-running tasks.

License

Notifications You must be signed in to change notification settings

saiga143/telegram-jupyter-notify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”” Telegram Notifications for Jupyter Notebooks

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.


πŸš€ What You’ll Learn

  • 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

πŸ“‚ Files in This Repo

File Description
telegram_notify_example.ipynb A step-by-step notebook with all the code and setup instructions
requirements.txt Python dependencies (just requests)

πŸ“² Getting Started

1. Install Requirements

pip install requests

2. Create a Telegram Bot

  • Open Telegram and start a chat with @BotFather
  • Type /newbot and follow instructions to create your bot
  • Copy the API token that @BotFather gives you

3. Get your Chat ID

  • 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.

4. Open the notebook

  • Open telegram_notify_example.ipynb
  • Replace PASTE_YOUR_BOT_TOKEN_HERE and PASTE_YOUR_CHAT_ID_HERE with your values
  • Run the cells and see the magic ✨

πŸ’‘ Use Cases

  • 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

πŸ” Security Notes

  • 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

πŸ™ Acknowledgements

Developed by Sai Ganesh Veeravalli, part of the DEPRIMAP Project at Karlstad University (https://sola.kau.se/deprimap/)

466517323-a180a6e3-1b60-429d-b0b8-c14a45e4e190

About

πŸ“¬ Get Telegram messages when your Jupyter Notebook finishes running. A simple, secure, and useful setup for long-running tasks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published