MCPcopy Create free account
hub / github.com/KnowledgeXLab/LeanRAG / read_yaml

Function read_yaml

tools/io_file.py:249–262  ·  view source on GitHub ↗

读取YAML文件。 参数: - file_path (str): 文件路径。 - encoding (str): 文件编码格式,默认为 'utf-8'。 返回: - dict: 读取的YAML文件内容。

(file_path, encoding='utf-8')

Source from the content-addressed store, hash-verified

247 return json.load(f)
248
249def read_yaml(file_path, encoding='utf-8'):
250 """
251 读取YAML文件。
252
253 参数:
254 - file_path (str): 文件路径。
255 - encoding (str): 文件编码格式,默认为 'utf-8'。
256
257 返回:
258 - dict: 读取的YAML文件内容。
259 """
260 with open(file_path, 'r', encoding=encoding) as f:
261 logger.info(f"读取YAML文件: {file_path}")
262 return yaml.safe_load(f)
263
264
265def read_xlsx(file_path, encoding='utf-8'):

Callers 1

readFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected