def gff3_parse_attributes(attributes_string):
    """
    Parse a string of GFF3 attributes ('key=value' pairs delimited by ';') 
    and return a dictionary.
  
    """
    
    attributes = dict()
    fields = attributes_string.split(';')
    for f in fields:
        if '=' in f:
            key, value = f.split('=')
            attributes[unquote_plus(key).strip()] = unquote_plus(value.strip())
        elif len(f) > 0:
            # not strictly kosher
            attributes[unquote_plus(f).strip()] = True            
    return attributes
def gff3_parse_attributes ( attributes_string ) : attributes = dict ( ) fields = attributes_string . split ( ';' ) for f in fields : if '=' in f : key , value = f . split ( '=' ) attributes [ unquote_plus ( key ) . strip ( ) ] = unquote_plus ( value . strip ( ) ) elif len ( f ) > 0 : attributes [ unquote_plus ( f ) . strip ( ) ] = True return attributes
Parse a string of GFF3 attributes ('key=value' pairs delimited by ';') 
    and return a dictionary.