No project description provided
Project description
JupNotiPy
Simple class for Python Telegram bot notifications, ideal for Jupyter notebooks and long-running scripts.
How this works
JupNotiPy uses your Telegram bot to send you messages. The process involves two main steps:
- Initialization: Required for obtaining a chat_id.
- Sending: Used for sending notifications through the given bot.
Basic usage scenario:
- Create a Telegram bot and get the bot token.
- Initialize the notifier in a Jupyter notebook or any long-running script.
- Send a message after work is done.
from jupnotipy import TNotifier
notifier = TNotifier(bot_token="YOUR_BOT_TOKEN")
notifier.init_notification()
# do some work or execute jupyter cells
notifier.notify(text="Define some text to send after work is done")
Advanced usage scenario:
- After the first initialization, you obtain your chat_id for the bot.
- Pass this chat_id on initialization to skip the initialization part.
- Use as usual.
from jupnotipy import TNotifier
notifier = TNotifier(bot_token="YOUR_BOT_TOKEN", chat_id=00000, username="MyLord")
notifier.notify(text="")
Security Note
- The initialization process uses a unique text (UUID) to identify the user, which provides a basic level of security.
- However, users should be cautious about sharing their bot tokens or chat IDs.
Limitations
- The polling mechanism in init_notification() has a default timeout, which can be adjusted using the polling_freq parameter.
- The module assumes a stable internet connection for API communication.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jupnotipy-0.1.0.tar.gz
(3.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jupnotipy-0.1.0.tar.gz.
File metadata
- Download URL: jupnotipy-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.0 CPython/3.12.3 Darwin/23.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ec3b97c218d74e0062cb0769a751ca1f39817c0be654d46572927aa7c1b47c1
|
|
| MD5 |
5b8a1429897a77261ffe002969c08103
|
|
| BLAKE2b-256 |
969870e26bb9c5d40e9c960a17d860a2a9249f45bb526b76e7e9ec8f431762cd
|
File details
Details for the file jupnotipy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jupnotipy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.0 CPython/3.12.3 Darwin/23.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3a58367eea0454bb688822d9bc87c3b7ab5c302ddc76e6bffe57c0393ae2025
|
|
| MD5 |
5d00a7e271e346f0e504047c8942f099
|
|
| BLAKE2b-256 |
f7b3c251d6f0307504068c44d6a77e93bbd2cafe9d672216e1e4350d437a16c9
|