Spaces:
Sleeping
Sleeping
File size: 366 Bytes
38f2246 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 11 12:56:00 2023
Copyright (c): Shamim Ahamed
"""
import yaml
from addict import Dict
class MyDict(Dict):
def __missing__(self, name):
raise KeyError(name)
def read_yaml(fpath):
with open(fpath, mode="r") as file:
yml = yaml.safe_load(file)
return MyDict(yml) |