import re


def clean(string):
    """Parses string into valid python variable name

    https://stackoverflow.com/questions/3303312/
    how-do-i-convert-a-string-to-a-valid-variable-name-in-python
    """
    string = re.sub('[^0-9a-zA-Z_]', '_', string)  # Replace invalid with _
    return re.sub('^[^a-zA-Z_]+', '', string)