Closed gitmapd closed 4 years ago
This would be a useful improvement. Currently DATE
is defined as a bash variable so it can be used in the git commit message (see https://github.com/tomwhite/covid-19-uk-data#daily-workflow), so I'm not sure the best way to keep these consistent.
I'd try this parser.add_argument("-s", "--start-date", dest="date", default=date.today() - timedelta(days = 1), type=lambda d: datetime.strptime(d, '%Y%m%d').date(), help="Date in the format yyyymmdd") You could then call the argument directly at the end with the date variable
I fixed this by creating a little wrapper script (update.sh
).
You say in your TODO you want to add a default date. Why not adding an argument parser and add a calculation for a date instead of using sys.argv[i]?