Skip to main content

Send yourself real time alerts and update messages about your projects on any platform

Project description

Drop dead simple alerts and updates for every project on any platfrom! This package lets your code send messages to you about its status. As of now, the best option is using Telegram (other platforms will be added in the future).

Drop this into your code:

Installation

pip install dakia

Usage

from dakia import Dakia

tbot = Dakia(token='secret1', chatId='something2', 'StockBot')
rbot = Dakia(token='secret1', chatId='something2', 'RenderBot')

genbot = Dakia(token='secret3', chatId='something3')

# Multiple messengers for seprate tasks / projects
if win:
    tbot.dak('-alert brrr')
else:
    tbot.dak('-warning oof')

if renderComplete:
    rbot.dak('-alert 3d render is complete)

genbot.dak(f"🔥 #new-user-signup {username}")
genbot.dak(f"💵 #sale {amount}")
genbot.dak(f"🌟 #project-{projectName} deployed successfully")


genbot.dak('-warning #project-quotes-crawler : Memory usage > 80%')

License

MIT License

Extended Tutorial

How to setup Dakia bot

There are two parts to setting up the Dakia bot 1 - The Telegram bot 2 - The python package

My goals is to keep this tutorial very brief and lean. For any step that may have tutorials online, I will not explain them here and instead link to YouTube or blogs that do a better job.

The Telegram part

This is a one time setup activity. Once sorted, you dont have to bother with it ever again. You can use the same bot for multiple projects.

Here we seek jus two things,

  • The bot token (messages sent via this bot)
  • The chat id (messages sent to this user/channel)

Steps:

Creating the bot

  • Install, then open telegram on your phone
  • Search for @BotFather, then type /newbot
  • Select a name for your bot, in this example we use YourAlertsBot
  • Get the token and keep it aside

Initializing the bot

  • Search for the bot, press Start and message it with hi
  • Select the 'hi' message and forward it to another bot named @jsondumpbot

Now you have two items with you, The chat id and the bot token. With this, head over to the Python side.

The Python part

We begin with installing package, importing the module and finally send the test message. pip install dakia Inside our code file--

from dakia import Dakia
BOT_TOKEN = '<your bot token>'
CHAT_ID = '<your chat id>'
PROJECT = '<your project name>'
pm = Dakia(BOT_TOKEN, CHAT_ID, PROJECT)


pm.dak('-update Its Alive!')

That's it. Now for any number of alerts, simply type pm.dak('-someFlag hi mom!') and the message is sent to you.

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

dakia-0.0.3.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

dakia-0.0.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file dakia-0.0.3.tar.gz.

File metadata

  • Download URL: dakia-0.0.3.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.0

File hashes

Hashes for dakia-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f7c899efdd3a058859af44e28211693a6cf8ee7cc4356798db79caddab85c5c3
MD5 5b00130b7c7d0c06356ed6ecc517c7a1
BLAKE2b-256 d544e54b8c5d34748728d112bc4b5f0a0055f7a63ee3aa859023a4f9c60e8678

See more details on using hashes here.

File details

Details for the file dakia-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: dakia-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.0

File hashes

Hashes for dakia-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bfc35565bfb72284018e508b5de45f8ed588cd4c234e61076815efb48ae1988e
MD5 c7a91629a3076b0196d03beeb5bb85d6
BLAKE2b-256 047c99d4bd47f48b7440d75a6bd4aca4730cf44251e1723322860783485bd97d

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