MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / load_knowledge_standards

Function load_knowledge_standards

scripts/verify_standards_consistency.py:28–50  ·  view source on GitHub ↗

Load all standards from knowledge repo category files.

(knowledge_root: Path)

Source from the content-addressed store, hash-verified

26
27
28def load_knowledge_standards(knowledge_root: Path) -> dict:
29 """Load all standards from knowledge repo category files."""
30 hs_dir = knowledge_root / "eu_mdr" / "standards"
31 os_dir = knowledge_root / "eu_mdr" / "other_standards"
32
33 hs_standards = {}
34 os_standards = {}
35
36 for f in sorted(hs_dir.iterdir()):
37 if f.name.startswith("standards-") and f.suffix == ".json":
38 with open(f) as fp:
39 data = json.load(fp)
40 for s in data.get("standards", []):
41 hs_standards[s.get("id", s.get("number", ""))] = s
42
43 for f in sorted(os_dir.iterdir()):
44 if f.name.startswith("standards-") and f.suffix == ".json":
45 with open(f) as fp:
46 data = json.load(fp)
47 for s in data.get("standards", []):
48 os_standards[s.get("id", s.get("number", ""))] = s
49
50 return {"harmonised": hs_standards, "other": os_standards}
51
52
53def load_docmcp_standards(docmcp_root: Path) -> list:

Callers 1

verifyFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected