X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/calendar?a=blobdiff_plain;ds=sidebyside;f=enhance_table.py;h=f44252463130075d456b6faf0d593b8144528c10;hb=3cde66c0f3ccba038fb9098a5552f79e0e75ea15;hp=c5c11c22bfe1d52518243e13a279ad800c77301d;hpb=dc7fd6818afda18eb8e2d0c8c99af29ccf3655c1;p=berlin-corona-table diff --git a/enhance_table.py b/enhance_table.py index c5c11c2..f442524 100755 --- a/enhance_table.py +++ b/enhance_table.py @@ -134,22 +134,23 @@ for i in range(len(sorted_dates)): db[district][date]['week_incidence'] = (week_sum / district_pop) * 100000 # Optimized for web browser viewing. +import calendar if output_type == 'html': print("""
Updated daily at 9pm based on data from the "Senatsverwaltung für Gesundheit, Pflege und Gleichstellung". Source code. Text view optimized for terminal curl.
+Updated daily at 9pm based on data from the "Senatsverwaltung für Gesundheit, Pflege und Gleichstellung". Source code. Plain text view (optimized for terminal curl).
""") @@ -160,17 +161,19 @@ th { text-align: left; vertical-align: bottom; } print(' | %s | ' %
translate[district])
print('||
---|---|---|---|
date | ') - print('? | ') - for district in sorted_districts: - print('%s | ' % - (translate[district], district)) - print('|
date | ') + print('? | ') + for district in sorted_districts: + print('%s | ' % + (translate[district], district)) + print('|
%s | ' % date) + weekday = calendar.day_name[datetime.date.fromisoformat(date).weekday()] + print('%s %s | ' % (date, weekday))
print('
| ')
print('