Migrate deliveries
This commit is contained in:
@ -47,12 +47,14 @@ def parse(filename: str) -> Iterator[Dict[str, Any]]:
|
||||
part = False
|
||||
elif part.isdigit():
|
||||
part = int(part)
|
||||
elif re.match(r'[0-9]+\.[0-9]+', part):
|
||||
elif re.match(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()
|
||||
elif len(part) == 8 and part[2] == ':' and part[5] == ':':
|
||||
part = datetime.time.fromisoformat(part)
|
||||
else:
|
||||
raise RuntimeError(part)
|
||||
raise RuntimeError(f'unable to infer type of value "{part}"')
|
||||
obj[header[i]] = part
|
||||
yield obj
|
||||
|
||||
|
Reference in New Issue
Block a user