Skip to main content

One Notification system for all platforms

Project description

Notifly

Code Usage

PyPI PyPI - Downloads Discord

GitHub Workflow Status GitHub Workflow Status

Logo

Table of Contents

About the package

Simple Bots to push notifications during an event trigger.

"Telegram" wrapper to send messages, images, files over the bot using API.
"Discord" wrapper to send message, images, files to the channel using Webhooks.
"Slack" wrapper to send message, images, files to the channel using API.

Built With

Prerequisites

  • Python
    It is preinstalled in Ubuntu 20.04. To check the version use command :
python3 --version

If it is not preinstalled for some reason, proceed here and download as per requirement.

Run the following command in terminal to download the required packags for running the tool locally :

  • Using requirements file :
pip3 install -r requirements.txt
  • Directly download packages:
pip3 install requests==2.24.0
pip3 install matplotlib==3.2.2
pip3 install slackclient==2.9.3

Install the package

Run the following terminal commands to install the package on the given distros.

  • Termux :
pkg install python3 
pip3 install notifly
  • Ubuntu/Debian
sudo apt install python3-pip
pip3 install notifly
  • Arch
sudo pacman -S python3-pip
pip3 install notifly

This may take a while depending on the network speed.

Working of the tool

Telegram

To see how the tool works,

  1. Create the telegram bot.
  2. Getting the bot API token
    1. Search and go to _@Botfather_ .
    2. Message /mybots .
    3. Select the bot.
    4. Select the API token displayed in message.
    5. Copy and use in sample code.
    from notifly import telegram        #import the package    
    x = telegram.BotHandler('bot API token')        #create object of class BotHandler
    x.send_message('message')       #send message
    x.send_image("image address")        #send image(.jpg or .png format)
    x.send_document("file address")     #send document
    x.session_dump()        #creates folder named 'downloads' in local folder, downloads/saves message,chat details for current session in 'sessio_dump.json' file
    
  3. Run sample code.

Discord

To see how the tool works,

  1. Create server.
  2. Create and copy server webhook and use in sample code.
    from notifly import discord
    x = discord.Notifier(r'webhook')       #create object of class Notiflier
    x.send_message('message')      #send message
    x.send_file("file address")        #send file
    x.send_file("image address")       #send image
    
  3. Run sample code.

Slack

To see how the tool works,

  1. Create app. Follow these steps,
    1. Go here.
    2. Go to Create an App .
    3. Enter App Name and select workspace. Click Create App.
    4. Under Add features and functionality select Incoming Webhooks and Activate Incoming Webhooks.
    5. Scroll down, select Add New Webhook to Workspace and select a channel from the drop down.This channel name is used as an argument in the sample code. Click Allow.
    6. Select OAuth & Permissions from left-sidebar.
    7. Under Scopes > Bot Token Scopes click Add an OAuth Scope and add the following scopes,
      chat:write   chat:write.public   files:write   users:write
    8. Scroll up, under OAuth Tokens for Your Team copy the Bot User OAuth Access Token to use in sample code.
    9. Click Reinstall to Workspace, select channel and click Allow.
  2. Write sample code.
    from notifly import slack
    x= slack.Notifier('token', channel='channel-name')      #create object of class Notiflier
    x.send_message('message')      #send message
    x.send_file("image or file address")      #send image/file
    
  3. Run sample code.

Contributing

  1. Fork the Project
  2. Create your Feature Branch

    git checkout -b feature/mybranch

  3. Commit your Changes

    git commit -m 'Add something'

  4. Push to the Branch

    git push origin feature/mybranch

  5. Open a Pull Request

    Follow the given commands or use the amazing GitHub GUI
    Happy Contributing

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

notifly-1.2.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

notifly-1.2.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file notifly-1.2.0.tar.gz.

File metadata

  • Download URL: notifly-1.2.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.9.0

File hashes

Hashes for notifly-1.2.0.tar.gz
Algorithm Hash digest
SHA256 6d828f64b606a8b82ce648bdb68babd537fb47ecbded5d3d2ab9ca1fbf3cd869
MD5 bd3ced805b00c2da8e530b69f31e56e6
BLAKE2b-256 62a2d55dbe8e505ad964ec740d49ff12dc2cb5079deed40629acf577d6690465

See more details on using hashes here.

File details

Details for the file notifly-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: notifly-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.9.0

File hashes

Hashes for notifly-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54a9561321bb5de9168e6d2ea1a0fb4439ff22d0efb2de1fcde15d4ee137db57
MD5 9a47b2d77071bc48607a1d8cdbf241f8
BLAKE2b-256 7dfca9315193d4c70ed41c2048ce0b3719dcac252071912fac0b21cd2db0dfcf

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