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.1.tar.gz (3.9 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.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jupnotipy-0.1.1.tar.gz
  • Upload date:
  • Size: 3.9 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.1.tar.gz
Algorithm Hash digest
SHA256 de787e58a07914e111c4cf8d4338666fd8572cafd186731688ae66c9abb99b0e
MD5 281ba0467616520945edc6cd4733bbb7
BLAKE2b-256 a5c7ea1dce71d07367b085095db625cd15cf669aa92317bc1f3aa6e8d0a34265

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jupnotipy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2212544982c690781c02810bd83d4743d1238ad0df49cfd8005d81522b5bac03
MD5 edf3430fde323478aa0e315660ea92ad
BLAKE2b-256 d96b92b15707e42c53a47bc23ceee4e8569d506ab742bdb96720a403f319a540

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