Get Current COVID-19 Cases 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 covid
- This kind of stuff done with web scraping.
- You can also done this with beautiful soup module.
Source Code:
Get Current COVID-19 Cases (WorldWide)
#Follow @Programmerfect
#Get Current COVID-19 Cases(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 Current COVID-19 Cases(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 Current COVID-19 Cases (INDIA)
#Follow @Programmerfect
#Get Current COVID-19 Cases of any Country Using Python
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 Current COVID-19 Cases of any Country Using Python
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)