1
0
Fork 0

fix: RKI changed the format of the effective date

This commit is contained in:
Benedikt Bastin 2021-06-17 16:40:55 +02:00
parent 876970991b
commit 7183e322e3

View file

@ -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