def str_to_span(string):
    """ Return the equivalent interval time in seconds.

    Parameters
    ----------
    string : str
        Time periodicity

    Returns
    -------
    span : int
        Number of seconds in time interval.

    Examples
    --------
    >>> str_to_span('minutely')
    60

    """
    if string.lower() in ['weekly', 'week', '7d', '1w', 'w']:
        return 604800
    elif string.lower() in ['daily', 'day', '24h', '1d', 'd']:
        return 86400
    elif string.lower() in ['bi-hourly', 'bi-hour', '2h']:
        return 7200
    elif string.lower() in ['hourly', 'hour', '1h', '60min', 'h']:
        return 3600
    elif string.lower() in ['half-hourly', 'half-hour', '30min']:
        return 1800
    elif string.lower() in ['5-minute', 'five-minute', '5 minute',
        'five minute', '5min']:
        return 300
    elif string.lower() in ['minutely', 'minute', '1min', 'min']:
        return 60
    else:
        print('Error, string not understood.\nString must be "minutely",',
            '"5 minute", "hourly", "daily" or "weekly".')
