Skip to main content

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:

  1. Initialization: Required for obtaining a chat_id.
  2. Sending: Used for sending notifications through the given bot.

Basic usage scenario:

  1. Create a Telegram bot and get the bot token.
  2. Initialize the notifier in a Jupyter notebook or any long-running script.
  3. 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:

  1. After the first initialization, you obtain your chat_id for the bot.
  2. Pass this chat_id on initialization to skip the initialization part.
  3. 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.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupnotipy-0.1.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file jupnotipy-0.1.2.tar.gz.

File metadata

  • Download URL: jupnotipy-0.1.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.0 CPython/3.12.3 Darwin/23.5.0

File hashes

Hashes for jupnotipy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f48082f57c305314023562fa1f6f4c0680b63e1409c16196c4165de515d63c08
MD5 4a786bf9980d90fda8de4a00be750f35
BLAKE2b-256 4509ccf7c9104298b16b770e99d7b4041056a560bd3a207da4324d518a0b3d3a

See more details on using hashes here.

File details

Details for the file jupnotipy-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: jupnotipy-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 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

Hashes for jupnotipy-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dd9673625db8cc120a45b639fb18c21ab6975c8e51946b921e9a4903e82b9b46
MD5 0b78367e71f810e229436a0af0503174
BLAKE2b-256 35093c2ddd191b725d26131144ec04a74ce209a458fc6b70fb2934f48b347e47

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page