Get Corona Virus Cases Using Python

Get Corona Virus Cases Using Python

Get Corona Virus Cases Using Python

Today’s Article on “Get Corona Virus Cases Using Python“.

Coronavirus firstly identifies in 2019 at Wuhan, China and now coronavirus spread globally.

According to WHO This virus is very dangerous.

Rules:

  • Regularly clean your hand with alcohol-based hand run and after that wash hand with soup.
  • Maintain 1m distance with another person.
  • Avoid going into crowd areas.
  • Avoid touching any body part like eyes, face. Etc.

By using this program you can get total death, active, recovered number of COVID-19 cases.

We use covid module for this project.

To install the covid module firstly we need to open terminal and type:

pip install covid 

This type of program done using web scraping it means getting data from other websites.

Get current Coronavirus Cases of WorldWide

from covid import Covid

covid = Covid()

def covid_worldwide():

        print(covid.get_total_active_cases())

        print(covid.get_total_confirmed_cases())

        print(covid.get_total_recovered())

        print(covid.get_total_deaths())

covid_worldwide()

Get Corona Virus Cases Using Python

Get current  Corona Virus of India

from covid import Covid

covid = Covid()

india = covid.get_status_by_country_name(“india”)

data = {

        key : india[key]

        for key in india.keys() and {“confirmed”,

                                     “active”,

                                     “deaths”,

                                     “recovered”}

}

print(data)

Get Corona Virus Cases Using Python

Harsh

Hey Friends, Welcome to thetechbuddy. This blog is about technical or programming knowledge.

Leave a Reply