import re


def sanitize_name(name):
    """Sanitize locator name for use in filenames.
    Sanitized name should be unique in database.

    Examples:
        Google.Logo -> google-logo
        Cool Stuff -> cool-stuff
        What?? -> what
    """
    # Convert everything to lowercase
    name = str(name).lower()
    # Replace period delimiters with single space
    name = re.sub(r"\.+", " ", name)
    # Strip non-word characters
    name = re.sub(r"[^\w\s]", "", name)
    # Strip leading/trailing whitespace
    name = name.strip()
    # Convert whitespace runs to single dash
    name = re.sub(r"\s+", "-", name)

    return name