X-Git-Url: https://plomlompom.com/repos/?p=berlin-corona-table;a=blobdiff_plain;f=enhance_table.py;h=0482bdfbffbf8fe0e89bb174454b04f561318a92;hp=02a7ac9b30b8cd0375a79a49468e2dc5c19e3d77;hb=5252dee46a33cce9616ba4e4103b59dba2ec44c1;hpb=6771de0510415071eeddf46e698ff6ba5234583d diff --git a/enhance_table.py b/enhance_table.py index 02a7ac9..0482bdf 100755 --- a/enhance_table.py +++ b/enhance_table.py @@ -17,6 +17,23 @@ district_pops = { 'sum': 3754418, } +# Map abbreviations to full names. +translate = { + 'CW': 'Charlottenburg-Wilmersdorf', + 'FK': 'Friedrichshain-Kreuzberg', + 'Li': 'Lichtenberg', + 'MH': 'Marzahn-Hellersdorf', + 'Mi': 'Mitte', + 'Ne': 'Neukölln', + 'Pa': 'Pankow', + 'Re': 'Reinickendorf', + 'Sp': 'Spandau', + 'SZ': 'Steglitz-Zehlendorf', + 'TS': 'Tempelhof-Schöneberg', + 'TK': 'Treptow-Köpenick', + 'sum': 'all of Berlin', +} + # Read infections table path and output type. import sys if len(sys.argv) != 3: @@ -156,21 +173,10 @@ elif output_type == 'txt': Updated daily around 9pm. Abbrevations/explanations: - -CW: Charlottenburg-Wilmersdorf -FK: Friedrichshain-Kreuzberg -Li: Lichtenberg -MH: Marzahn-Hellersdorf -Mi: Mitte -Ne: Neukölln -Pa: Pankow -Re: Reinickendorf -Sp: Spandau -SZ: Steglitz-Zehlendorf -TS: Tempelhof-Schöneberg -TK: Treptow-Köpenick -sum: sum for all the districts -wsum: sum for last 7 days +""" + for k in translate: + intro += "%s: %s\n" % (k, translate[k]) + intro += """wsum: sum for last 7 days wavg: per-day average of new infections for last 7 days winc: incidence (x per 100k inhabitants) of new infections for last 7 days