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

Function get_source_url

scripts/extract_mdcg_images.py:20–31  ·  view source on GitHub ↗
(doc_id)

Source from the content-addressed store, hash-verified

18ASSET_DIR = REPO_ROOT / "assets" / "images" / "mdcg"
19
20def get_source_url(doc_id):
21 zh_file = ZH_DIR / f"{doc_id}.md"
22 if not zh_file.exists():
23 zh_file = REPO_ROOT / "eu_mdr" / "mdcg" / f"{doc_id}.zh.md"
24 if not zh_file.exists():
25 return None
26 content = zh_file.read_text(encoding="utf-8")
27 for line in content.split("\n"):
28 if line.startswith("source_url:"):
29 url = line.split("source_url:", 1)[1].strip()
30 return url
31 return None
32
33def process_doc(doc_id):
34 url = get_source_url(doc_id)

Callers 1

process_docFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected