Skip to content

Commit d1a3c13

Browse files
sort: Depreciated program.
API service discontinued.
1 parent b7c81a2 commit d1a3c13

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed

depreciated_programs/corona_cases.py

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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 india():
47+
cases = f"""
48+
██╗███╗░░██╗██████╗░██╗░█████╗░
49+
██║████╗░██║██╔══██╗██║██╔══██╗
50+
██║██╔██╗██║██║░░██║██║███████║
51+
██║██║╚████║██║░░██║██║██╔══██║
52+
██║██║░╚███║██████╔╝██║██║░░██║
53+
╚═╝╚═╝░░╚══╝╚═════╝░╚═╝╚═╝░░╚═╝
54+
55+
Country Name :- {name}
56+
New Confirmed Cases :- {indiaonfirmed}
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+
░╚════╝░░╚════╝░╚═╝░░╚═╝░╚════╝░╚═╝░░╚══╝╚═╝░░╚═╝  ░░░╚═╝░░░╚═╝╚═╝░░╚═╝░╚═════╝░╚═════╝░"""
75+
)
76+
print("\nDeveloped By @TheDarkW3b")
77+
78+
79+
def choices():
80+
print("\n1 - To Know Corona Virus Update Across World")
81+
print("\n2 - To Know Corona Virus Update In India")
82+
choice = input("Enter 1 Or 2 :- ")
83+
84+
if choice == "1":
85+
world()
86+
sleep(1)
87+
choices()
88+
elif choice == "2":
89+
india()
90+
sleep(1)
91+
choices()
92+
else:
93+
print("\nYou Have Entered Something Wrong, Please Enter Again")
94+
choices()
95+
96+
97+
choices()

0 commit comments

Comments
 (0)