def parsable_duration_validator(input_str):
    """
    A filter allowing any duration string which can be parsed
    by parsedatetime.
    Raises ValidationError otherwise.
    """
    try:
        get_timedelta_from_str(input_str)
        return input_str
    except ValueError:
        raise ValidationError(
            'Expected format: a duration (e.g. 1m, 1s, 1h3m)'
            '(Ctrl-C to exit)\n'
        )

    A filter allowing any duration string which can be parsed
    by parsedatetime.
    Raises ValidationError otherwise.
    
gcalcli/validators.py