dft-core/dft/base/config.py

17 lines
324 B
Python

import yaml
def get_config_from_yml(filepath="dft_project.yml"):
try:
with open(filepath, 'r') as file:
data = yaml.safe_load(file)
except Exception as e:
return e
else:
return data
def load_config():
data = get_config_from_yml()
return data
config = load_config()