Skip to main content

Fetch COVID-19 Report Using Python

To know the statistics of a pandemic disease COVID-19, python has a module named "covid". It extracts information about all the countries affected by this deadly disease. The information was provided by John Hopkins by default and worldometers to get specific content. It mainly works on python versions above 3.5.



Installation

To use the covid module, first, install it using,
        pip install covid

Source Selection

covid module use john hopkins source by default. To select source as john hopkins, use ,
        covid or
        covid -s john_hopkins in command line.
where -s indicates source.
To select source as worldometers, use 
        covid -s worldometers

Report on all the countries affected

To get the list of all the countries affected, use
covid -s worldometers --list-countries
On specifying this code, the output will be,

List of all countries affected

Getting a report of a specific country

To fetch report of a specific country, use
covid -s worldometers -c india
where -s indicates source of information and -c denotes country.
On specifying this code, the output will be,

Report of India

Report on active cases

To extract count on total active cases in the world use,
covid -s worldometers -o active
On specifying this code, the output will be,

Total active cases

Report on confirmed cases

To extract details about confirmed case use,
covid -s worldometers -o confirmed
On specifying this code, the output will be,

Total confirmed cases

Report on recovered cases

To get the count on recovered cases use,
covid -s worldometers -o recovered
On specifying this code, the output will be,

Total recovered cases

Report on deaths

To get reports on deaths, use
covid -s worldometers -o deaths
On specifying this code, the output will be,

Total death counts




Comments

Popular posts from this blog

How to Create A Voice Recorder Using Python

  A voice recorder records a sound or a voice of a person and converts it into an audio file. The file can be stored in different audio formats like MP3 format, Waveform Audio File (WAV), Advanced Audio Coding (AAC), Audio Interchange File Format (AIFF), etc. and later it can be transferred to other devices. Any device that is capable of recording a sound or a voice is said to be a voice recorder by default. In this article, you will learn to build a voice recorder with a few lines of code in Python. Where do We Use Voice Recorder? Some of the applications of a voice recorder are listed below: Interviews Handling Meetings Lectures/Seminars in Educational Institutions Audiobooks for kids Learning foreign languages Translating a word to another language Google search by voice A quick voice message to a person instead of typing Podcasts Voice assistants like Google assistants, Alexa, Siri, etc., Essentials The first and foremost thing needed to build a voice recorder using Python is t...

Translating text from one language to another using python

The definition of a translator is a  person who helps people who speak different languages to communicate or who take something  (such as a speech or a book) in one language and who puts it into a different language for people to understand.   This functionality can be achieved using the  googletrans module in python. googletrans module     The googletrans module is one of the fast and flexible libraries in python that implements Google Translate API,  to detect the language of text automatically and to convert text from one language to another. By default, all the languages are translated to English. Installation      This module can be installed by using,                pip install googletrans     googletrans can be used after installation and importation of the module               import googletrans or       ...

Interacting With System Applications Through OS Module In Python

 As we all know, Operating System (OS) is a program that acts as an interface between computer hardware and user. Python has a standard utility module called "os module" to achieve a process of communicating directly to the operating system of your device. Installation The os module is one of the standard libraries in Python 3, so it doesn't need to be installed manually or externally. It comes along with the installation of Python. So it is mandatory to import this os module before using it in your program as it is not a built-in function. Importing module The os module can be used in a program by importing it initially. It is mandatory to import the os module as it is not a built-in function to use it without any importation. To import the os module, use the command as import os Built-in functions inside os module There are a bunch of built-in functions present inside the os module where one can invoke each function after the module gets imported inside a program.  To k...