from pathlib import Path import yaml class ProfileDB: def __init__(self): with Path('~/games/.saves/profiles.yaml').expanduser().open() as fp: self.profiledb = yaml.safe_load(fp) def get_profiles(self): # currently contains {name, display} return self.profiledb['profiles']