Skip to main content

The spiritual successor to knockknock for PyTorch Lightning, get notified when your training ends

Project description

Who's there?

PyPI - Package Version Conda - Platform Conda (channel only)

Build PyPI - Python Version Dependencies Status

Code style: black Security: bandit Pre-commit Semantic Versions GitHub - License

The spiritual successor to knockknock for PyTorch Lightning, to get a notification when your training is complete or when it crashes during the process with a single callback.

🚀 Features

  • Supports E-Mail, Discord, Slack, Teams, Telegram

🎯 Installation

You can install whos-there with pip or poetry or conda.

with pip

pip install -U whos-there

with poetry

poetry add whos-there

with conda

conda install -c conda-forge whos-there

🤯 How to use it

from whos_there.callback import NotificationCallback
from whos_there.senders.debug import DebugSender

trainer = pl.Trainer(
    callbacks=[
        NotificationCallback(senders=[
            # Add your senders here
            DebugSender(),
        ])
    ]
)

E-Mail

Requires your e-mail provider specific SMTP settings.

from whos_there.senders.email import EmailSender
# ...
EmailSender(
    host="smtp.example.de",
    port=587,
    sender_email="from@example.com",
    password="*********",
    recipient_emails=[
        "to1@example.com",
        "to2@example.com",
    ]
)

Discord

Requires your Discord channel's webhook URL.

from whos_there.senders.discord import DiscordSender
# ...
DiscordSender(
    webhook_url="https://discord.com/api/webhooks/XXXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
)

Slack

Requires your Slack room webhook URL and optionally your user id (if you want to tag yourself or someone else).

from whos_there.senders.slack import SlackSender
# ...
SlackSender(
    webhook_url="https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
    channel="channel_name",
    user_mentions=[
        "XXXXXXXX"
    ]
)

Teams

Requires your Team Channel webhook URL.

from whos_there.senders.teams import TeamsSender
# ...
TeamsSender(
    webhook_url="https://XXXXX.webhook.office.com/",
    user_mentions=[
        "twsl"
    ]
)

Telegram

You can also use Telegram Messenger to get notifications. You'll first have to create your own notification bot by following the three steps provided by Telegram here and save your API access TOKEN. Telegram bots are shy and can't send the first message so you'll have to do the first step. By sending the first message, you'll be able to get the chat_id required (identification of your messaging room) by visiting https://api.telegram.org/bot<YourBOTToken>/getUpdates and get the int under the key message['chat']['id'].

from whos_there.senders.telegram import TelegramSender
# ...
TelegramSender(
    chat_id=1234567890,
    token="XXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXX"
)

🛡 License

License

This project is licensed under the terms of the MIT license. See LICENSE for more details.

🏅 Credits

This project was generated with 🚀 Your next Python package needs a bleeding-edge project structure.

Big thanks to knockknock for the idea and code snippets.

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

whos_there-0.1.5.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

whos_there-0.1.5-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file whos_there-0.1.5.tar.gz.

File metadata

  • Download URL: whos_there-0.1.5.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.8.16 Linux/5.15.0-1031-azure

File hashes

Hashes for whos_there-0.1.5.tar.gz
Algorithm Hash digest
SHA256 07bfb7a57d1f94895662a2d2421caaa3e8ed1995fc4d11ab5005f2160d924b2a
MD5 c49136f7b025a565bc3e7c6aa0b77b05
BLAKE2b-256 8af6873308b99e48c25fd82a488db715fe8879a9c87df7a9885dbeafece77a3d

See more details on using hashes here.

File details

Details for the file whos_there-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: whos_there-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.8.16 Linux/5.15.0-1031-azure

File hashes

Hashes for whos_there-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7270ce0d962fe5b74713aef95693a4dd3d9f48b1f51d06ab09a630b8c1bf4774
MD5 0dd96fdba00e70867a23cb1cc24b3b64
BLAKE2b-256 cdecb4096a61f2a83ec8a15b3462d85deef9d992bcd2f199025b9b5ec14f6b4d

See more details on using hashes here.

Supported by

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