Collection of COVID-19 data & scripts used and maintained by Our World in Data.
NOTE: We plan to keep the data up to date for our own purposes only. We may stop maintaining this repository at any point.
Up until 17 March 2020, we were using WHO data manually extracted from their daily situation report PDFs.
From 19 March 2020, we started relying on data published by the European CDC. We wrote about why we decided to switch sources.
- We convert all country/region names to Our World in Data standard entity names.
- We may correct or discard inconsistencies that we detect in the original data. Check our notes on ECDC data for examples.
The /public
path of this repository is hosted at https://covid.ourworldindata.org/
using Netlify.
We do our best to keep all past URLs working, however we may decide to stop maintaining data extracts at any point. The order and names of the CSV columns may also change.
-
You must have Python 3.
Check whether you do by running
python3 --version
. -
You must have pip installed.
Check whether you do by running
pip3 --version
. -
Install virtualenv (if you don't have it):
pip3 install virtualenv
-
Create a virtual environment for the project (run at the root of this repository):
virtualenv venv
-
Activate the virtual environment:
source venv/bin/activate
-
Install all dependencies:
pip3 install -r requirements.txt
To download the latest data and update the CSVs, run:
python3 scripts/ecdc.py
You will be asked for the release you want to use. The script should automatically download any new releases from today and yesterday, you will only need to select which one you want when prompted.
If the automatic download doesn't seem to work, then:
-
Download the release manually from the ECDC website
-
Move it to the
/input/ecdc/releases
folder in this repository and rename it to the date it refers to in ISO date format (e.g.2020-03-20
). -
Run the script again:
python3 scripts/ecdc.py
If you get an error saying some entities are missing Our World in Data names, then:
-
There should be a file at
/tmp/ecdc.csv
in the repository. Upload this file to the Country name standardizer of the Our World in Data Grapher. -
Make sure to create a name for every single entity.
-
Download the standardized
ecdc_country_standardized.csv
file and move it to/input/ecdc/ecdc_country_standardized.csv
in this repository. -
Run the script again:
python3 scripts/ecdc.py
If you get an error unrelated to the above, something might have changed with the dataset and you will need to change the script, or something isn't installed correctly.