# -*- coding: utf-8 -*-
# @Time    : 2024/6/7
# @Author  : 魏志亮

import yaml


def yaml_conf(path, encoding='utf-8'):
    with open(path, 'r', encoding=encoding) as f:
        data = yaml.safe_load(f)
    return data


def read_conf(dict_conf, col, default_value=None):
    if col in dict_conf:
        res = dict_conf[col]
        if res is None and default_value is not None:
            return default_value
        return res
    else:
        return default_value

