Skip to content

Instantly share code, notes, and snippets.

@spinscale
Created January 27, 2021 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spinscale/7bb467a60c5e883abe42ea8bbdf2faff to your computer and use it in GitHub Desktop.
Save spinscale/7bb467a60c5e883abe42ea8bbdf2faff to your computer and use it in GitHub Desktop.
Download RKI data and extrapolate full first vaccination
#!/bin/bash
# retrieve URL
url="https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Daten/Impfquotenmonitoring.xlsx?__blob=publicationFile"
wget -o /dev/null $url -O out.xlsx
# convert to csv
# run 'pip3 install xlsx2csv' (or maybe pip depending on your python installation)
xlsx2csv -a out.xlsx out.csv
# figure out the number of days we got vaccination data
# exclude those with no vaccination happening
days=$(grep -c '^[01][0-9].*,[1-9]\d*,\d*,\d*' out.csv/Impfungen_proTag.csv)
# extract the total number of vaccinations
total_first_vaccinations=$(grep ^Gesamt, out.csv/Impfungen_proTag.csv| cut -d',' -f2)
# average vaccinations per day so far, multiply with 1.0 to get floats
average_vaccinations_per_day=$(echo "scale=2;$total_first_vaccinations/$days" | bc -l)
# figure out how many days we need to wait for everyone to be vaccinated
population=83000000
days=$(echo "scale=0;$population/$average_vaccinations_per_day" | bc)
years=$(echo "scale=2;$days/365.0" | bc)
RED='\033[0;31m'
NC='\033[0m'
echo -e "Days until full vaccination: ${RED}$days${NC} (aka ${RED}$years${NC} years)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment