def __init__(self, filename): self.filename = filename with open(filename, 'r') as f: self.data = yaml.load(f, Loader=yaml.RoundTripLoader)