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 and Total cases and/or list of dictionaries 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': 'USA', 'TotalCases': '104,256', 'NewCases': '+130', 'TotalDeaths': '1,704', 'NewDeaths': '+8', 'TotalRecovered': '2,525', 'ActiveCases': '100,027', 'Critical': '2,494', 'CasesPerOneMillion': '315', 'DeathsPerOneMillion': '5', 'FirstCase': 'Jan 20'}, {'Country': 'Italy', 'TotalCases': '86,498', 'NewCases': '', 'TotalDeaths': '9,134', 'NewDeaths': '', 'TotalRecovered': '10,950', 'ActiveCases': '66,414', 'Critical': '3,732', 'CasesPerOneMillion': '1,431', 'DeathsPerOneMillion': '151', 'FirstCase': 'Jan 29'}]
# Get the latest case of specific country
print(get_country_cases("USA"))
Sample output:
{'Country': 'USA', 'TotalCases': '104,256', 'NewCases': '+130', 'TotalDeaths': '1,704', 'NewDeaths': '+8', 'TotalRecovered': '2,525', 'ActiveCases': '100,027', 'Critical': '2,494', 'CasesPerOneMillion': '315', 'DeathsPerOneMillion': '5', 'FirstCase': 'Jan 20'}
# Get the total data in more informative way
print(get_total_cases())
Sample output:
{'Country': 'Total:', 'TotalCases': '613,828', 'NewCases': '+17,516', 'TotalDeaths': '28,229', 'NewDeaths': '+888', 'TotalRecovered': '137,223', 'ActiveCases': '448,376', 'Critical': '23,995', 'CasesPerOneMillion': '78.7', 'DeathsPerOneMillion': '3.6', 'FirstCase': ''}
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.2.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for COVID_19_Cases-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b14609568cd81c0358276d3d4c48dca081c61bf23a35d3239af1dcb79e1e1f91 |
|
MD5 | 4fc20f2941b93746e8d93827ef7089ff |
|
BLAKE2b-256 | 141b33ec2f6cee33c842f1a7f657f81fb75dc9b62238af50f924ceb2d2dbf399 |