Create Desktop Notifier using Python

Ayushi Rawat
Nov 22 · 3 min read

In this Blog article, we will learn how to send Desktop notifications . We will see the implementation in Python.

Image for post
Image for post

Repository for Ultimate Resource in python. Drop a star if you find it useful! Got anything to add? Open a PR on the same!

You can refer to my YouTube video tutorial for better Understanding

What will be covered in this Blog

1. Desktop Notification Introduction
2. What is Plyer?
3. Create a Desktop Notifier

Desktop Notification:

Dictionary defination:

The Purpose:

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.

What is Plyer?

Plyer is a Python library for accessing features of your hardware / platforms.

If you wish to know more about it, you can refer to Plyer Documentation. Use this link to navigate to the documentation.

Other areas where you can use this approach

  1. Set daily tracker for COVID stats
  2. Daily notification to take medicine.
  3. Hourly notification to drink water.

and many more, it’s completely up to you how to use this application.

Now that you are aware of Desktop Notification and Plyer basics, we can move forward to the coding section.

Time to code!

You can find all the code at my GitHub Repository. Drop a star if you find it useful.

Image for post
Image for post

Installing Plyer

Open your terminal and run the following command

pip install plyer

Now that we have the package, we are ready to import it in our python script.

from plyer import notification

Now let’s specify the parameters. Lets define the title and message.

title = 'Hello Amazing people!'message= 'Thankyou for reading! Take care!'

Let’s look at what the parameters mean:

  • title: Title of the notification
  • message: Message of the notification
  • app_name: Name of the app launching this notification
  • app_icon: Icon to be displayed along with the message
  • timeout: time to display the message for, defaults to 10
  • ticker: text to display on the status bar as the notification arrives
  • toast: simple message instead of full notification

Now, let’s pass the parameters using notify method.

notification.notify(title= title,
message= message,
app_icon = None,
timeout= 10,
toast=False)

I am passing:

  • the title as `'Hello Amazing people!'``
  • `message as 'Thankyou for reading! Take care!'
  • app_icon as None
  • timeout as 10 secs
  • and toast as False.

That’s it! We are done. Now let’s save and run our python script.

Image for post
Image for post

Here is our desktop Notification. Simple, isn’t it? Hope this tutorial has helped.

You can play around with the library, explore more features and even customize it further.

You can find all the code at my GitHub Repository. Drop a star if you find it useful.

Thank you for reading, I would love to connect with you at Twitter.

Do share your valuable feedback and suggestions!

You should definitely check out my other Blogs:

Resources:

See you in my next Blog article, Take care

Analytics Vidhya

Analytics Vidhya is a community of Analytics and Data…

Sign up for Analytics Vidhya News Bytes

By Analytics Vidhya

Latest news from Analytics Vidhya on our Hackathons and some of our best articles! Take a look

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Ayushi Rawat

Written by

I am a software Engineer. I m passionate about learning new stuffs. I like to read and code. Music calms my soul.

Analytics Vidhya

Analytics Vidhya is a community of Analytics and Data Science professionals. We are building the next-gen data science ecosystem https://www.analyticsvidhya.com

Ayushi Rawat

Written by

I am a software Engineer. I m passionate about learning new stuffs. I like to read and code. Music calms my soul.

Analytics Vidhya

Analytics Vidhya is a community of Analytics and Data Science professionals. We are building the next-gen data science ecosystem https://www.analyticsvidhya.com

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store