Skip to content

Commit 886da13

Browse files
Merge pull request #783 from TheDarkW3b/master
Added CoronaVirus Cases Detector
2 parents dba18d3 + 5335602 commit 886da13

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

coronacases.py

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import sys
2+
3+
try:
4+
import requests
5+
except ImportError:
6+
print("Please Install Requests Module With Command 'pip install requests'")
7+
sys.exit(1)
8+
from time import sleep
9+
10+
url = "https://api.covid19api.com/summary"
11+
visit = requests.get(url).json()
12+
13+
NewConfirmed = visit['Global']['NewConfirmed']
14+
TotalConfirmed = visit['Global']['TotalConfirmed']
15+
NewDeaths = visit['Global']['NewDeaths']
16+
TotalDeaths = visit['Global']['TotalDeaths']
17+
NewRecovered = visit['Global']['NewRecovered']
18+
TotalRecovered = visit['Global']['TotalRecovered']
19+
20+
india = visit['Countries']
21+
name = india[76]['Country']
22+
indiaconfirmed = india[76]['NewConfirmed']
23+
indiatotal = india[76]['TotalConfirmed']
24+
indiaDeaths = india[76]['NewDeaths']
25+
deathstotal = india[76]['TotalDeaths']
26+
indianewr = india[76]['NewRecovered']
27+
totalre = india[76]['TotalRecovered']
28+
DateUpdate = india[76]['Date']
29+
30+
31+
def world():
32+
world = f'''
33+
▀▀█▀▀ █▀▀█ ▀▀█▀▀ █▀▀█ █░░   ▒█▀▀█ █▀▀█ █▀▀ █▀▀ █▀▀   ▀█▀ █▀▀▄   ▒█░░▒█ █▀▀█ █▀▀█ █░░ █▀▀▄
34+
░▒█░░ █░░█ ░░█░░ █▄▄█ █░░   ▒█░░░ █▄▄█ ▀▀█ █▀▀ ▀▀█   ▒█░ █░░█   ▒█▒█▒█ █░░█ █▄▄▀ █░░ █░░█
35+
░▒█░░ ▀▀▀▀ ░░▀░░ ▀░░▀ ▀▀▀   ▒█▄▄█ ▀░░▀ ▀▀▀ ▀▀▀ ▀▀▀   ▄█▄ ▀░░▀   ▒█▄▀▄█ ▀▀▀▀ ▀░▀▀ ▀▀▀ ▀▀▀░\n
36+
New Confirmed Cases :- {NewConfirmed}
37+
Total Confirmed Cases :- {TotalConfirmed}
38+
New Deaths :- {NewDeaths}
39+
Total Deaths :- {TotalDeaths}
40+
New Recovered :- {NewRecovered}
41+
Total Recovered :- {TotalRecovered}
42+
'''
43+
print(world)
44+
45+
46+
def indiac():
47+
cases = f'''
48+
██╗███╗░░██╗██████╗░██╗░█████╗░
49+
██║████╗░██║██╔══██╗██║██╔══██╗
50+
██║██╔██╗██║██║░░██║██║███████║
51+
██║██║╚████║██║░░██║██║██╔══██║
52+
██║██║░╚███║██████╔╝██║██║░░██║
53+
╚═╝╚═╝░░╚══╝╚═════╝░╚═╝╚═╝░░╚═╝
54+
55+
Country Name :- {name}
56+
New Confirmed Cases :- {indiaconfirmed}
57+
Total Confirmed Cases :- {indiatotal}
58+
New Deaths :- {indiaDeaths}
59+
Total Deaths :- {deathstotal}
60+
New Recovered :- {indianewr}
61+
Total Recovered :- {totalre}
62+
Information Till :- {DateUpdate}
63+
'''
64+
print(cases)
65+
66+
67+
print('''
68+
░█████╗░░█████╗░██████╗░░█████╗░███╗░░██╗░█████╗░  ██╗░░░██╗██╗██████╗░██╗░░░██╗░██████╗
69+
██╔══██╗██╔══██╗██╔══██╗██╔══██╗████╗░██║██╔══██╗  ██║░░░██║██║██╔══██╗██║░░░██║██╔════╝
70+
██║░░╚═╝██║░░██║██████╔╝██║░░██║██╔██╗██║███████║  ╚██╗░██╔╝██║██████╔╝██║░░░██║╚█████╗░
71+
██║░░██╗██║░░██║██╔══██╗██║░░██║██║╚████║██╔══██║  ░╚████╔╝░██║██╔══██╗██║░░░██║░╚═══██╗
72+
╚█████╔╝╚█████╔╝██║░░██║╚█████╔╝██║░╚███║██║░░██║  ░░╚██╔╝░░██║██║░░██║╚██████╔╝██████╔╝
73+
░╚════╝░░╚════╝░╚═╝░░╚═╝░╚════╝░╚═╝░░╚══╝╚═╝░░╚═╝  ░░░╚═╝░░░╚═╝╚═╝░░╚═╝░╚═════╝░╚═════╝░''')
74+
print("\nDeveloped By @TheDarkW3b")
75+
76+
77+
def choices():
78+
print("\n1 - To Know Corona Virus Update Across World")
79+
print("\n2 - To Know Corona Virus Update In India")
80+
choice = input("Enter 1 Or 2 :- ")
81+
82+
if choice == "1":
83+
world()
84+
sleep(1)
85+
choices()
86+
elif choice == "2":
87+
indiac()
88+
sleep(1)
89+
choices()
90+
else:
91+
print("\nYou Have Entered Something Wrong, Please Enter Again")
92+
choices()
93+
94+
95+
choices()

0 commit comments

Comments
 (0)