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

Function _load_existing

scripts/fetch_nifdc_standards.py:229–240  ·  view source on GitHub ↗

Load existing standards.json into a dict keyed by standard number.

()

Source from the content-addressed store, hash-verified

227 }
228
229
230def filter_active_only(rows: list[dict]) -> list[dict]:
231 return [r for r in rows if r.get("status") in ("active", "upcoming")]
232
233
234def _load_existing() -> dict[str, dict]:
235 """Load existing standards.json into a dict keyed by standard number."""
236 out_path = OUT_DIR / "standards.json"
237 if not out_path.exists():
238 return {}
239 try:
240 with open(out_path, "r", encoding="utf-8") as f:
241 items = json.load(f)
242 return {r["number"]: r for r in items if isinstance(r, dict) and "number" in r}
243 except Exception as e:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected