Update delivery import

This commit is contained in:
2023-04-03 11:32:34 +02:00
parent c8652ba211
commit 1de0498c35
2 changed files with 14 additions and 11 deletions

View File

@ -45,9 +45,9 @@ def parse(filename: str) -> Iterator[Dict[str, Any]]:
part = True
elif part == 'F':
part = False
elif part.isdigit():
elif re.fullmatch(r'-?[0-9]+', part):
part = int(part)
elif re.match(r'-?[0-9]+\.[0-9]+', part):
elif re.fullmatch(r'-?[0-9]+\.[0-9]+', part):
part = float(part)
elif len(part) == 10 and part[4] == '-' and part[7] == '-':
part = datetime.datetime.strptime(part, '%Y-%m-%d').date()