def crop_scores(player):
    """Select specific only parts of the full score object

    Args:
        player (dict): player object from which to read the score

    Returns:
        score (dict): filtered scores from the game data
    """
    score = {}
    # if there is no active username, nobody finished, but the
    # last seen player might still get a valid rank
    if player['username'] in ['dead', 'open']:
        score['finished'] = 0
        score['rank'] = player['finishrank']
        return score
    
    keys_wanted = [
        'capitalships',
        'freighters',
        'planets',
        'starbases',
        'militaryscore',
        'percent',
    ]
    score = {k: player['score'].get(k, None) for k in keys_wanted}
    score['finished'] = 1
    score['rank'] = player['finishrank']
    return score