MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / load_json_file

Function load_json_file

scripts/common.py:72–76  ·  view source on GitHub ↗
(path: str | Path)

Source from the content-addressed store, hash-verified

70
71
72def load_json_file(path: str | Path) -> dict[str, Any]:
73 data = json.loads(Path(path).expanduser().resolve().read_text(encoding="utf-8"))
74 if not isinstance(data, dict):
75 raise RuntimeError("Expected a JSON object.")
76 return data
77
78
79def maybe_load_json_record(value: str | None) -> dict[str, Any] | None:

Callers 1

maybe_load_json_recordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected