Scripts used internally to generate and standardize the data files.
For information on our vaccination automated scripts, check here.
-
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.