Python

Desktop notifier app using python

Notifications help people to remember things. It is a small piece of text which appears on the desktop or mobile screen to inform the user about the updates or any other important pieces of information. This allows the user to focus on important things and ignore the non-important ones. The notifications are stored in the notification bar which you can refer after finishing your works. In this python project, you will learn to develop an application which will notify the user.

We will include the URL in the program from where the necessary information should be fetched. Before starting the project ensure you have installed the newest version of Python and install the libraries - notify2 and BeautifulSoup.

Read more..


notify2 - Install this library using the following command

pip install notify2

BeautifulSoup - It is a library used to fetch data from the HTML and XML files. It helps the programmers to save a lot of time. BeautifulSoup is widely used to fetch information from the webpages.

In this python project, we are going to display the rate of bitcoins in INR. Following is the process followed to build the project:

Step1: Fetch the content to display

Step2: Set up the notifier

Step3: Display the content in the form of a notification

Let’s start with the scrapping process,


Latest projects on Python

Want to develop practical skills on Python? Checkout our latest projects and start learning for free


Fetching the content

The first step is to import bs4-

from bs4 import BeautifulSoup

import requests

def fetch_bitcoin():

URL that we want to fetch the information is included.

url = "https://www.coingecko.com/en/price_charts/bitcoin/inr"

    headers = {'User-Agent': 'Mozilla/5.0'}

    bitcoin_file = requests.get(url)

The soup object is formatted.

    soup = BeautifulSoup(bitcoin_file.text, "html.parser")

    bitcoin_li = []

Now, we will get the necessary information from the website after observing the site structure.

    for table in soup.find_all("table", attrs={"class" : "table"}):

        for td in table.find_all("td"):

            bitcoin_li.append(td.text)

    del bitcoin_li[3:]

Let’s remove the unwanted characters from the list items.

    bitcoin_li = map(lambda s : s.strip(), bitcoin_li)

    return bitcoin_li

So far, we have created a program to fetch the bitcoin information from the given URL in the form of a list.

Setting up the notifier

We have fetched the required information to display let’s set up the notifier.

First, import the libraries.

import notify2

import Rates

Define the function

def notify():

    icon_path = "full path to the icon image"

Now fetch the bitcoin rate   

bitcoin = Rates.fetch_bitcoin()

Initialise the D-BUS connection. It is a message system which connects two applications to talk to each other. D-BUS connection for notify2 is initialized:

notify2.init("Cryptocurrency rates notifier")

Let’s create a notification object

n = notify2.Notification("Crypto Notifier", icon = icon_path)

Following is the structure of the notification object:

notify2.Notification(summary, message='body text', icon='icon path')

Set the importance level of the notification like - High, normal and low.

n.set_urgency(notify2.URGENCY_NORMAL)

Finally, set the timeout for the notification

n.set_timeout(1000)

Displaying the content

Now the notifier is ready, we will create the code to display the content.

result = ""

result = result + str(bitcoin[0]) + "  -  " + str(bitcoin[2].encode('utf-8')) + "\n"

# Update the content

n.update("Current Rates", result)

# Show the notification

n.show()

First, The content is displayed with the help of list returned from the fetch_bitcoin function then we update the notifier with the required content and finally the content is displayed with the help of n.show().


How to build Python projects Did you know

Skyfi Labs helps students learn practical skills by building real-world projects.

You can enrol with friends and receive kits at your doorstep

You can learn from experts, build working projects, showcase skills to the world and grab the best jobs.
Get started today!


Kit required to develop Desktop notifier app using python:
Technologies you will learn by working on Desktop notifier app using python:
Desktop notifier app using python
Skyfi Labs Last Updated: 2022-04-16





Join 250,000+ students from 36+ countries & develop practical skills by building projects

Get kits shipped in 24 hours. Build using online tutorials.

More Project Ideas on Python

Face recognition using Raspberry Pi
Linux Based Medication remainder
Ultrasonic beats player
Automated door opener with lighting control
IoT based theft detection using Raspberry Pi
Wheelchair wih safety system
Raspberry Pi osilloscope
Health monitoring using Raspberry pi
Automatic Green house system
Wheel combined robotic suspension system
Bank Account Management System using SQL and C++
Content Aggregation Project using Python
URL Shortener
Develop An Expense Tracking System using Python
Mp3 Player using Python
Simple Chat room using Python
Folder sorter according to files extensions using Python
Batch Image editor using Python
Password Generator and Manager using Python
Web Scrapper (Amazon Price Tracker)
Bird Species detection using Python
Develop An Online CV Builder using Python
Online Job Portal using Python and SQL database
Social Media Site using Python (Django)
Driver Drowsiness detection using Python
Traffic recognition using python
Website Blocker using python
Speech Emotion Recognition using Python
Speed Typing test with Python
Gender and Age Detection using Python
Pharmacy management using Python
Virtual Notebook - Python project
Find My Professor
How to Develop a TIC TAC TOE game using Python
Admission tracking system
Assignment submission system using Python
Smart feedback system using Python
Data collection tool using Python
Language translator and converter using Python
Automatic Brand LOGO detection using Python
Rock, paper, scissor game using python
Youtube video downloader with Tkinter UI python project
Instagram bot using python
Desktop notifier app using python
Spotify song downloader using python
Jarvis Personal assistant using Python
Sound processing python project
Develop a Supermarket Billing System with Python
Desktop voice assistant project

Subscribe to receive more project ideas

Stay up-to-date and build projects on latest technologies