A python script that generates latest data set of COVID-19 cases around the globe.
Project description
COVID-19 Cases
A python script that generates latest data set of COVID-19 cases around the globe.
Setup
pip install COVID-19-Cases
Usage
The script will return a dictionary for the Global cases and/or list of dictionary for the Country cases
import covid19cases as covid
# Get the latest cases around the globe
print(covid.get_global_cases())
Sample output:
{'Cases': '590,424', 'Deaths': '26,950', 'Recovered': '132,458'}
# Get the latest cases of all affected Countries
print(covid.get_country_cases())
Sample output:
[{'Country': 'China', 'TotalCases': '81,340', 'NewCases': '+55', 'TotalDeaths': '3,292', 'NewDeaths': '+5', 'TotalRecovered': '74,588', 'ActiveCases': '3,460', 'Critical': '1,034', 'CasesPerOneMillion': '57', 'DeathsPerOneMillion': '2'}, {'Country': 'USA', 'TotalCases': '100,514', 'NewCases': '+15,079', 'TotalDeaths': '1,546', 'NewDeaths': '+251', 'TotalRecovered': '2,465', 'ActiveCases': '96,503', 'Critical': '2,463', 'CasesPerOneMillion': '304', 'DeathsPerOneMillion': '5'}]
# Get the latest case of specific country
print(covid.get_country_cases("Italy"))
Sample output:
{'Country': 'Italy', 'TotalCases': '86,498', 'NewCases': '+5,909', 'TotalDeaths': '9,134', 'NewDeaths': '+919', 'TotalRecovered': '10,950', 'ActiveCases': '66,414', 'Critical': '3,732', 'CasesPerOneMillion': '1,431', 'DeathsPerOneMillion': '151'}
The data will change from time to time.
Source
I get the data on this site https://www.worldometers.info/coronavirus/ via Web scraping.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
COVID-19-Cases-0.0.1.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for COVID_19_Cases-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65cb70441bd34f82d1dc51b2cd31e677d465d0f8a9b2f7f824e961b39f2b2b05 |
|
MD5 | 39cc7b0302ce544ba68226e4caab2f09 |
|
BLAKE2b-256 | e6b10391360a9f07a3835b066679fbac16cbe7c0d39d5392a0b1aec6d6311ed7 |