Return the lowercase name if this name adheres to requirements, None
    otherwise.
    The requirements are:
      * only alphanumeric characters or dashes
      * no number at the start
      * no double dashes or dashes at the start or end of the name
      * no empty string
      * no string bigger than maxlength

def valid(name, maxlength=None):
    '''
    Return the lowercase name if this name adheres to requirements, None
    otherwise.
    The requirements are:
      * only alphanumeric characters or dashes
      * no number at the start
      * no double dashes or dashes at the start or end of the name
      * no empty string
      * no string bigger than maxlength
    '''

    if not name:
        return None
    if maxlength is not None and len(name) > maxlength:
        return None
    name = name.lower()
    if name.endswith('-') or name.startswith('-') or '--' in name:
        return None
    if name[0] in string.digits:
        return None
    for c in name:
        if c not in string.digits+string.ascii_lowercase+'-':
            return None

    return name