MINIPROJECT (PYTHON)
COVID TRACKER USING PYTHON
pip install covid
First we have to install pip library then install covid module from pip using about line.
from covid import Covid
Using this line we can import the covid module in a program. Using this module we can get the data about covid cases like number of cases confirmed, number of cases recovered, number of total deaths, number of active cases, COVID present countries, In each country how many cases.
from covid import Covid
print(“COVID TRACKER”)
c=Covid()
cont=”yes”
active=c.get_total_active_cases()
recovered=c.get_total_recovered()
confirmed=c.get_total_confirmed_cases()
death=c.get_total_deaths()
print(“The choices available are: “)
print(“1.Active cases”)
print(“2.Recovered cases”)
print(“3.Confirmed cases”)
print(“4.Total deaths”)
print(“5.Details about cases by country”)
print(“6.Covid available countries list”)
while(cont==”yes”):
print(“Enter your choice: “)
choice=int(input())
if(choice==1):
print(“active cases: “,active)
elif(choice==2):
print(“recovered_cases: “,recovered)
elif(choice==3):
print(“confirmed cases: “,confirmed)
elif(choice==4):
print(“total deaths: “,death)
elif(choice==5):
country=input(“Enter your country: “)
status_by_country=covid.get_status_by_country_name(country)
print(status_by_country)
elif(choice==6):
countries = covid.list_countries()
print(countries)
else:
print(“NO! That kind of Option so I am giving all data about covid”)
print(covid.get_data())
print(“Do you want to continue?? yes/no”)
cont=input()
Based on user choice the output will be printed. The data about covid cases automatically updated and printed.
covid.get_total_active_cases() #this function will give the active cases
covid.get_total_confirmed_cases() #this function will give the no. of confirmed cases
covid.get_total_confirmed_cases() #this function will give the confirmed cases
covid.get_total_confirmed_cases() #this function will give the no. of deaths
#These are built in functions already available in covid module
Github link for source code: