def str2dict_keys(str_in):
    '''
    Extracts the keys from a string that represents a dict and returns them
    sorted by key.
    Args:
        str_in (string) that contains python dict
    Returns:
        (list) with keys or None if no valid dict was found
    Raises:
        -
    '''
    tmp_dict = str2dict(str_in)
    if tmp_dict is None:
        return None
    return sorted([k for k in tmp_dict])