def parse_iso_duration(value: str) -> timedelta:
    '\n    Parses duration string according to ISO 8601 and returns timedelta representation (it excludes year and month)\n    http://www.datypic.com/sc/xsd/t-xsd_dayTimeDuration.html\n    :param str value:\n    :return dict:\n    '
    if (not ISO_8601_TIME_DURATION_REGEX.match(value)):
        raise ValueError(f'Passed value {value} is not valid ISO-8601 duration.')
    duration = ISO_8601_TIME_DURATION_REGEX.fullmatch(value)
    sign = ((- 1) if duration.group('sign') else 1)
    kwargs = {'weeks': ((int(duration.group('weeks')) * sign) if duration.group('weeks') else 0), 'days': ((int(duration.group('days')) * sign) if duration.group('days') else 0), 'hours': ((int(duration.group('hours')) * sign) if duration.group('hours') else 0), 'minutes': ((int(duration.group('minutes')) * sign) if duration.group('minutes') else 0), 'seconds': ((float(duration.group('seconds')) * sign) if duration.group('seconds') else 0)}
    return timedelta(**kwargs)
Parses duration string according to ISO 8601 and returns timedelta representation (it excludes year and month)
http://www.datypic.com/sc/xsd/t-xsd_dayTimeDuration.html
:param str value:
:return dict:
def parse_iso_duration(value: str) -> timedelta:
    '\n    Parses duration string according to ISO 8601 and returns timedelta representation (it excludes year and month)\n    http://www.datypic.com/sc/xsd/t-xsd_dayTimeDuration.html\n    :param str value:\n    :return dict:\n    '
    if (not ISO_8601_TIME_DURATION_REGEX.match(value)):
        raise ValueError(f'Passed value {value} is not valid ISO-8601 duration.')
    duration = ISO_8601_TIME_DURATION_REGEX.fullmatch(value)
    sign = ((- 1) if duration.group('sign') else 1)
    kwargs = {'weeks': ((int(duration.group('weeks')) * sign) if duration.group('weeks') else 0), 'days': ((int(duration.group('days')) * sign) if duration.group('days') else 0), 'hours': ((int(duration.group('hours')) * sign) if duration.group('hours') else 0), 'minutes': ((int(duration.group('minutes')) * sign) if duration.group('minutes') else 0), 'seconds': ((float(duration.group('seconds')) * sign) if duration.group('seconds') else 0)}
    return timedelta(**kwargs)