def transform_user_info(user):
    """Converts lastfm api user data into neo4j friendly user data

    Args:
        user (dict): lastfm api user data

    Returns:
        dict - neo4j friendly user data
    """
    if 'user' in user:
        user = user['user']

    user['image'] = [element['#text'] for element in user['image']]
    user['registered'] = user['registered']['unixtime']
    user['playcount'] = int(user['playcount'])
    user['playlists'] = int(user['playlists'])
    user['registered'] = int(user['registered'])

    return user