def iso8601interval(value, argument='argument'):
 try:
  (start, end) = _parse_interval(value)
  if (end is None):
   end = _expand_datetime(start, value)
  (start, end) = _normalize_interval(start, end, value)
 except ValueError:
  raise ValueError('Invalid {arg}: {value}. {arg} must be a valid ISO8601 date/time interval.'.format(arg=argument, value=value))
 return (start, end)

def iso8601interval ( value , argument = 'argument' ) : try : ( start , end ) = _parse_interval ( value ) if ( end is None ) : end = _expand_datetime ( start , value ) ( start , end ) = _normalize_interval ( start , end , value ) except ValueError : raise ValueError ( 'Invalid {arg}: {value}. {arg} must be a valid ISO8601 date/time interval.' . format ( arg = argument , value = value ) ) return ( start , end )
parses iso 8601-formatted datetime intervals into tuples of datetimes .