X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=enhance_table.py;h=acbebc6b950905cab22a247a42010b69a15c166a;hb=5ece867536877574b33064933504740484e08797;hp=02a7ac9b30b8cd0375a79a49468e2dc5c19e3d77;hpb=a3d2a6533cb6aee29c48c8e1e08e4981c0c8829b;p=berlin-corona-table diff --git a/enhance_table.py b/enhance_table.py index 02a7ac9..acbebc6 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: @@ -119,7 +136,9 @@ if output_type == 'html': print('') print('date') for district in sorted_districts: - print('%s' % district) + long_form = translate[district] + print('%s' % long_form) print('') sorted_dates.reverse() for date in sorted_dates: @@ -156,21 +175,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