During the (late) devlopment of this script, I learned about rki-covid-api which offers this data, but as far as I could tell, only the most current data. For another project, I needed data for past days/weeks, so I continued working on this script. Now, rki-covid-data also has historic data, so this project is no longer needed.
This project can be used as-is, but is has been created to work in conjunction with riskjournal.
A simple (but inefficient) bash script to generate weekly incidence data for each administrative district (Landkreis)
The Robert Koch Institut (short: RKI) provides daily stats on the Covid-19 infections in Germany. They are available via ArcGIS as API and as a CSV download. The data is also archived by the NDR as CSV and by the ARD as JSON.
All of these data sources contain a lot of details, even up to individual infection cases.
The political discurse in Germany around Covid-19, as well as many tools (like Microcovid) operate with incidence data, specifically with the number of new Covid-19 cases per 100.000 inhabitants during the past 7 days, for each administrative district (Landkreis). It seems that this incidence data is not readily available anywhere.
You can either run this script:
- using Docker
- e.g. like this:
docker build -t cig . && docker run cig
- the docker version uses a
cron
job to update the data every 4 hours
- e.g. like this:
- directly, if you are on a unix-like system and have:
curl
gzip
bash
- a version of
date
that understands the-d
flag as described here, e.g. the coreutils version
To be improved, and then documented. Currently there's only a bunch of csv files.
- The script is very slow. It takes about 40 minutes on a 2017 MacBook Pro to complete.