stompy.parse_interval — Flexible ways of parsing time intervals

Some convenience routines for parsing interval inputs

stompy.parse_interval.parse_date_or_interval(s)[source]
stompy.parse_interval.parse_interval(s, default_start=None, default_end=None, default_days=None)[source]

s: the string to parse.

Format of s is start_spec:end_spec
start_spec :end_spec

Each can be either a date in YYYYMMDDHHMMSS format or a signed offset +/-XXXXunits the leading + or - MUST be included where units is d for days, h for hours, m for minutes, s for seconds

returns a pair of python datetime instances