From a6cfd5b838ea5bce6c4305c19f62860fcc19ca70 Mon Sep 17 00:00:00 2001 From: Josef Eberle Date: Sun, 16 May 2021 19:35:40 +0200 Subject: [PATCH] first release --- index.html | 231 ++++++++++++++----- python/__pycache__/updatehtml.cpython-37.pyc | Bin 966 -> 0 bytes python/index.html | 85 ------- python/requirements.txt => requirements.txt | 0 python/updatehtml.py => updatehtml.py | 39 ++-- 5 files changed, 204 insertions(+), 151 deletions(-) delete mode 100644 python/__pycache__/updatehtml.cpython-37.pyc delete mode 100644 python/index.html rename python/requirements.txt => requirements.txt (100%) rename python/updatehtml.py => updatehtml.py (67%) diff --git a/index.html b/index.html index 55a28926..df9d1b8e 100644 --- a/index.html +++ b/index.html @@ -12,9 +12,8 @@ text-decoration: none; color: #81A2BE; } - ul { - list-style-type: none; - padding: 0; + table { + margin: 1em auto; } .red { color: #CC6666; @@ -29,58 +28,186 @@ -

RKI Inzidenz Historie nach Landkreisen und Städten

+

RKI Inzidenz Historie

+

RKI Stand: 16.05.2021 +
Letztes Update: 2021-05-16 19:34:30.733886

SK Kaufbeuren

- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
03.05.139.65
04.05.159.92
05.05.139.65
06.05.139.65
07.05.144.15
08.05.135.14
09.05.146.40
10.05.164.42
11.05.159.92
12.05.130.64
13.05.141.90
14.05.123.88
15.05.85.59
16.05.83.34

LK Ostallgäu

- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
03.05.155.12
04.05.160.79
05.05.146.62
06.05.135.29
07.05.145.20
08.05.133.87
09.05.135.29
10.05.140.24
11.05.126.08
12.05.111.91
13.05.115.45
14.05.110.50
15.05.80.75
16.05.85.00

LK Weilheim-Schongau

- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
03.05.129.91
04.05.126.22
05.05.104.81
06.05.92.27
07.05.101.12
08.05.96.69
09.05.97.43
10.05.96.69
11.05.108.50
12.05.101.12
13.05.95.96
14.05.96.69
15.05.81.93
16.05.76.03
\ No newline at end of file diff --git a/python/__pycache__/updatehtml.cpython-37.pyc b/python/__pycache__/updatehtml.cpython-37.pyc deleted file mode 100644 index 0f118ddb9c6d9b6be247bcf487542315228127be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 966 zcmZ8fPjAyO6t|spbvw$?gb+tA93rv$j`-hh2#_iPLm&$&q_x*(P3+8embU6n zVvd`ba3Y8Zz9SxpP_)2?VoS8aw&a$eb7IDlY}yy-=Y39PAUcws6W)=b?3`oX{R}zZ zqYvl{k}VAWM-+AcKrJ+y0G8&2puG%0>?2SDukk%}MjSc@&sYCJ&H_i)M1<#L6Rd;d z@B(ABCXlT)TJ1ixELE#iNVSrxzsR%2VTAckl4ZJzjTEVo6K88ujiXjgjXWu(g*cc> zSBJWgs%}*#b&|IyS~;m)6!M@nSsfOMo7Le_n#mfQU&weS|4NoC$0qEPmBzBS+R7vL zTI*>h9}G=;Dp_Ilv9IWzsY&uYRZ~_h-ApTH=IP!Q*u7b5oi@v>Z)G78Cuc6t`o*&D z0z7!V$n2u!siB|{rua7A#pV|H6YOu`cqRjohQZt5IJCiQbb-&X^Bmz(6x7r=S}YeC z?`1j>aiz_Cto6JOp=c5jjNh%*VonESKxUbs)#^3wE`e`BD#byWWH42Z$OM}8c z5vZx%WQnlxz;34P{%_gmvdvCla|isI#&MpcDvnntGv^BXn6av=`anrvNH*MOgUeyD zH|ppmXCpR}Wnx@9l{Ow|qg8U6n$of%aH`k=Y{M#c7%Ff3-(dF| mVsCcu7s)it(kHnVWhS3_?(AJq6oyO*-J&54DA3%6f&T+W74k{| diff --git a/python/index.html b/python/index.html deleted file mode 100644 index 84fb4909..00000000 --- a/python/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - - RKI Inzidenz Historie - - - - -

RKI Inzidenz Historie nach Landkreisen und Städten

-

SK Kaufbeuren

-
    -
  • 139.65
  • -
  • 159.92
  • -
  • 139.65
  • -
  • 139.65
  • -
  • 144.15
  • -
  • 135.14
  • -
  • 146.40
  • -
  • 164.42
  • -
  • 159.92
  • -
  • 130.64
  • -
  • 141.90
  • -
  • 123.88
  • -
  • 85.59
  • -
  • 83.34
  • -
-

LK Ostallgäu

-
    -
  • 155.12
  • -
  • 160.79
  • -
  • 146.62
  • -
  • 135.29
  • -
  • 145.20
  • -
  • 133.87
  • -
  • 135.29
  • -
  • 140.24
  • -
  • 126.08
  • -
  • 111.91
  • -
  • 115.45
  • -
  • 110.50
  • -
  • 80.75
  • -
  • 85.00
  • -
-

LK Weilheim-Schongau

-
    -
  • 129.91
  • -
  • 126.22
  • -
  • 104.81
  • -
  • 92.27
  • -
  • 101.12
  • -
  • 96.69
  • -
  • 97.43
  • -
  • 96.69
  • -
  • 108.50
  • -
  • 101.12
  • -
  • 95.96
  • -
  • 96.69
  • -
  • 81.93
  • -
  • 76.03
  • -
-
- - \ No newline at end of file diff --git a/python/requirements.txt b/requirements.txt similarity index 100% rename from python/requirements.txt rename to requirements.txt diff --git a/python/updatehtml.py b/updatehtml.py similarity index 67% rename from python/updatehtml.py rename to updatehtml.py index dd77b993..2dc0b17e 100644 --- a/python/updatehtml.py +++ b/updatehtml.py @@ -2,8 +2,9 @@ import requests import tempfile import urllib.parse +import datetime -filter = [9777,9190,9762] +filter = ['LKNR',9777,9190,9762] def getrkixlsx(url, path): file = '%s/inzidenzen.xlsx' %(path) @@ -15,12 +16,17 @@ def getdata(file): xlsx = openpyxl.load_workbook(file, read_only=True) sheet = xlsx['LK_7-Tage-Inzidenz'] data = {} - for row in sheet.iter_rows(min_row=6, values_only=True): + for row in sheet.iter_rows(min_row=5, values_only=True): if not row[1] == None and row[2] in filter: + if row[2] == 'LKNR': + index = 'date' + else: + index = row[1] + if row[-1] == None: - data[row[1]] = row[-15:-1] + data[index] = row[-15:-1] else: - data[row[1]] = row[-14:] + data[index] = row[-14:] xlsx.close() return data @@ -42,9 +48,8 @@ def generatehtml(data, path): ' text-decoration: none;', ' color: #81A2BE;', ' }', - ' ul {', - ' list-style-type: none;', - ' padding: 0;', + ' table {', + ' margin: 1em auto;', ' }', ' .red {', ' color: #CC6666;', @@ -59,22 +64,28 @@ def generatehtml(data, path): ' ', ' ', ' ', - '

RKI Inzidenz Historie nach Landkreisen und Städten

', '' + '

RKI Inzidenz Historie

', + '

RKI Stand: %s' %(data['date'][-1].strftime("%d.%m.%Y")), '
' + ' Letztes Update: %s

' %(datetime.datetime.now()), '' ])) for lk in data: + if lk == 'date': continue id = urllib.parse.quote_plus(lk) f.write('

%s

\n' %(id, id, lk)) - f.write('
    \n') - for iz in data[lk]: - if iz <= 50: + f.write(' \n') + for i in range(len(data[lk])): + if data[lk][i] <= 50: color = "green" - elif iz <= 100: + elif data[lk][i] <= 100: color = "orange" else: color = "red" - f.write('
  • %1.2f
  • \n' %(color, iz)) - f.write(' \n') + f.write(' \n') + f.write(' \n' %(data['date'][i].strftime("%d.%m."))) + f.write(' \n' %(color, data[lk][i])) + f.write(' \n') + f.write('
    %s%1.2f
    \n') f.write('\n'.join([ ' ',