DEV Community

Shruti Sharma
Shruti Sharma

Posted on

COVID-19 update notifier with python

Hello Everyone! As you all know that COVID-19 pandemic has been doing a huge impact in our world.Some people search it on google for global data or some people still see at newspaper . What if we will get a popup for latest updates related to COVID-19 as well ? So recently i have made a COVID-19 update notifier which gives you a popup global updates(like how much death rates happened globally or recovered rates or cases ) for COVID-19 time to time.It's just a small code.So you don't need to worry about it.So lets get started.
Alt Text
HOW I BUILT?
I made it through python.Python is a general purpose language which is used anywhere like machine learning, GUI etc.In this project, I have used only 4 modules. So here it is.

Alt Text

What do they work?

1)Requests- The requests module is a external module which allows you to send HTTP requests using Python.
2)Win10toast- It is an easy way to get notified when some event occurs. The package is available in Pypi and it is installed using pip.
3)Json- The json module provides an API similar to convert in-memory Python objects to a serialized representation known as JavaScript Object Notation (JSON) and vice-a-versa.
4)Time - The time module provides functions for working with times, and for converting between representations.
After this,
Alt Text
I made a def function whose named is update .In def function , i made 'r' variable which we get a http file which is ' https://coronavirus-19-api.herokuapp.com/all 'with the help of request module.Then exchange the data by json and stored it in the 'data' variable.I have used a while condition so that it will gives the notification with the help of toast notifier.I also attached a timer to give a popup in 60 minutes with the help of time module.But you can change it as well......

Thank you!I hope you will like it.Next time for sure i will post some big project as well ....

Top comments (0)