Skip to content
This repository was archived by the owner on Dec 22, 2023. It is now read-only.

Commit db1d50c

Browse files
committed
2 parents 2c78357 + baf022d commit db1d50c

File tree

5 files changed

+72
-2
lines changed

5 files changed

+72
-2
lines changed

.all-contributorsrc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,17 @@
119119
"contributions": [
120120
"code"
121121
]
122+
},
123+
{
124+
"login": "Aravindha1234u",
125+
"name": "T3cH_W1z4rD",
126+
"avatar_url": "https://avatars0.githubusercontent.com/u/52521300?v=4",
127+
"profile": "https://aravindha1234u.github.io",
128+
"contributions": [
129+
"code"
130+
]
122131
}
123-
,
132+
],
124133
"contributorsPerLine": 7,
125134
"projectName": "Python_and_the_Web",
126135
"projectOwner": "Python-World",

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com)
77

88
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
9-
[![All Contributors](https://img.shields.io/badge/all_contributors-12-orange.svg?style=flat-square)](#contributors-)
9+
[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-)
1010
<!-- ALL-CONTRIBUTORS-BADGE:END -->
1111

1212
![Issues](https://img.shields.io/github/issues/Python-World/Python_and_the_Web)
@@ -107,6 +107,7 @@ We now have a section for miscellaneous scripts as well.
107107
<td align="center"><a href="https://github.com/Sahil-k1509"><img src="https://avatars1.githubusercontent.com/u/55683054?v=4" width="100px;" alt=""/><br /><sub><b>Sahil Bairagi</b></sub></a><br /><a href="https://github.com/Python-World/Python_and_the_Web/commits?author=Sahil-k1509" title="Code">💻</a></td>
108108
<td align="center"><a href="https://github.com/tauseefmohammed2"><img src="https://avatars2.githubusercontent.com/u/35351464?v=4" width="100px;" alt=""/><br /><sub><b>tauseefmohammed2</b></sub></a><br /><a href="https://github.com/Python-World/Python_and_the_Web/commits?author=tauseefmohammed2" title="Code">💻</a></td>
109109
<td align="center"><a href="https://ameyanrd.github.io/"><img src="https://avatars1.githubusercontent.com/u/42608371?v=4" width="100px;" alt=""/><br /><sub><b>Ameya Deshpande</b></sub></a><br /><a href="https://github.com/Python-World/Python_and_the_Web/commits?author=ameyanrd" title="Code">💻</a></td>
110+
<td align="center"><a href="https://aravindha1234u.github.io"><img src="https://avatars0.githubusercontent.com/u/52521300?v=4" width="100px;" alt=""/><br /><sub><b>T3cH_W1z4rD</b></sub></a><br /><a href="https://github.com/Python-World/Python_and_the_Web/commits?author=Aravindha1234u" title="Code">💻</a></td>
110111
</tr>
111112
</table>
112113

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# COVID19 Dashboard using Streamlit
2+
This is app built with streamlit framework to display live covid19 data across the world with help of api.covid19api.com as data source.
3+
4+
### Prerequisites
5+
* streamlit
6+
* requests
7+
* pytablewriter
8+
* datetime
9+
10+
or
11+
12+
`pip3 install requirements.txt`
13+
14+
### How to run the script
15+
16+
`streamlit run covid19.py`
17+
18+
Visit Local URL: http://localhost:8501 to view the app.
19+
20+
### Screenshot
21+
![Screenshot](https://i.imgur.com/zJQhxTq.png)
22+
23+
## *Author Name*
24+
[Aravindha Hariharan M](https://aravindha1234u.github.io)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import streamlit as st
2+
import requests
3+
from pytablewriter import MarkdownTableWriter
4+
from datetime import datetime
5+
6+
response = requests.get('https://api.covid19api.com/summary') # Get Request to pull down data from Covid19 data source
7+
data = response.json()
8+
9+
st.markdown(MarkdownTableWriter(
10+
table_name="Covid19 Worldwide Data",
11+
headers=["Total Confirmed", "Total Recovered", "Total Deaths"],
12+
value_matrix=[[data['Global']['TotalConfirmed'], data['Global']['TotalRecovered'], data['Global']['TotalDeaths']]],
13+
)) # To form a Table for Live World data stat
14+
15+
st.write("")
16+
st.write("**Last Updated Time: {} **".format(datetime.strptime(data['Date'][:-1],"%Y-%m-%dT%H:%M:%S").strftime("%b %d %Y %H:%M:%S")))
17+
# To Display the date & time of Last updated data of Covid19 Reports
18+
19+
st.write("")
20+
country = st.text_input("Enter Country Name:","") # Input to filter according to country name
21+
22+
table_data = [ [i['Country'],i['TotalConfirmed'],i['TotalRecovered'],i['TotalDeaths']] for i in data['Countries'] ]
23+
24+
if country != "":
25+
table_data=[]
26+
table_data = [ [i['Country'],i['TotalConfirmed'],i['TotalRecovered'],i['TotalDeaths']] for i in data['Countries'] if i['Country'].lower() == country.lower() ]
27+
# If country name is not entered then display all Country
28+
29+
st.markdown(MarkdownTableWriter(
30+
table_name="CountryWise Data",
31+
headers=["Country Name", "Confirmed", "Recovered", "Deaths"],
32+
value_matrix=table_data,
33+
)) # table to display countrywise count reports
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
streamlit
2+
requests
3+
pytablewriter

0 commit comments

Comments
 (0)