Get Current COVID-19 Cases in INDIA Using Python

Get Current COVID-19 Cases in INDIA Using Python 

  • Get the current COVID-19 cases, total death and recovered numbers using python.
  • Module used : covid  
  • To install this module open terminal and type : pip install COVID19Py
  • This kind of stuff done with web scraping

Source Code:

#Follow @Programmerfect
from covid import Covid
import matplotlib.pyplot as pyplot
country = input("Enter Your Country Name: ")
covid = Covid()
data = covid.get_status_by_country_name(country)
cadr = {
    key: data[key]
    for key in data.keys() & {"confirmed", "active", "deaths", "recovered"}
    }
n = list(cadr.keys())
v = list(cadr.values())
print(cadr)
pyplot.title(country)
pyplot.bar(range(len(cadr)), v, tick_label=n)
pyplot.show() 


Output: 

  • Active : 153106
  • Recovered : 169798
  • Confirmed : 332424
  • Deaths : 9520

Graph:

 

 

Comments