lib.dates module

Helper functions/classes related to dates/datetimes.

parse_date(date)[source]

Parses a date string.

Parameters

date (Union[str, date, datetime]) – The date string to parse.

This function defaults to using dateutil.parser.parse(), but also accepts the following special formats for date:

@t | @today

Today’s date.

Nd

N days ago.

Nw

N weeks ago.

Return type

date

parse_daterange(daterange)[source]

Transforms a date range specifier into a list of sequential dates.

Parameters

daterange (str) – A string of the form START_DATE:END_DATE where both START_DATE and END_DATE are any value that the parse_date() function can parse.

Return type

List[date]