def ellipsis(string, max_length=100):
    """Returns a length limited version of a string, up to ``max_length``
    characters.

    If the string is longer it will be cut preserving the starting part and an
    ellipsis will be added.
    """
    if len(string) <= max_length:
        return string
    else:
        return string[:max_length - 3] + '...'
