fix: RKI changed the format of the effective date
This commit is contained in:
parent
876970991b
commit
7183e322e3
1 changed files with 3 additions and 2 deletions
5
plot.py
5
plot.py
|
@ -209,9 +209,10 @@ def parse_rki(filename):
|
|||
# Stand aus offiziellen Angaben auslesen
|
||||
stand = rki_file['Erläuterung'].iloc[1][0]
|
||||
|
||||
stand_regex = re.compile('^Datenstand: (\d\d.\d\d.\d\d\d\d, \d?\d:\d\d) Uhr$')
|
||||
stand_regex = re.compile('^Datenstand: (\d{2}.\d{2}.(\d{2}|\d{4}), \d{1,2}:\d{2}) Uhr$')
|
||||
m = stand_regex.match(stand)
|
||||
stand_date = datetime.datetime.strptime(m.groups()[0], '%d.%m.%Y, %H:%M')
|
||||
stand_date_part = m.groups()[0].replace('.21,', '.2021,')
|
||||
stand_date = datetime.datetime.strptime(stand_date_part, '%d.%m.%Y, %H:%M')
|
||||
print_stand = stand_date.isoformat()
|
||||
|
||||
return dates, start_of_reporting_date, data_first_vaccination, data_second_vaccination, stand_date, print_stand
|
||||
|
|
Loading…
Reference in a new issue