This package makes COVID-19 data available through python API. All the data are directy taken from the CSSEGISandData-covi19 with the below mentioned data sources. There are several methods to extract the statistics and counts for the coutry or province.
covid-data-api
- Clone this repo.
- pip install -r requirements.txt
- python setup.py install
from covid.api import CovId19Data
api = CovId19Data(force=False)
If force = True, every time object is instantiated new data is downloaded. Otherwise data will be refreshed after 24 hrs.
Get the latest total stats for all confirmed, deaths and recovered till the latest date available.
res = api.get_stats()
res = api.get_all_records_by_country()
res = api.get_all_records_by_provinces()
To find all the countries availabe, plese use show_all_available_countries api.
res = api.filter_by_country("ireland")
To find all the countries availabe, plese use show_all_available_regions api.
res = api.filter_by_province("British Columbia")
res = api.show_available_countries()
res = api.show_available_regions()
res = api.get_history_by_country("ireland")
Shows all the country metrics confirmed, recovered and deaths for the dates till the latest date.
res = api.get_history_by_province("British Columbia")
Shows all the state/province metrics confirmed, recovered and deaths for the dates till the latest date.
All used data sources CSSEGISandData-covi19.
Please raise an issues with issues of this git repo. This is not actively supported, however anyone with the interest can solve the raised issues.
License: MIT
see also contributors
-
1.1, 1.2, 1.3 - Initial Versions
-
1.4 - Change in recovered cases in source CoViD data repository.