MCPcopy Create free account
hub / github.com/Open-Quant/openquant / main

Function main

scripts/generate_api_inventory.py:66–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64 m = PY_FN_RE.match(line.strip())
65 if not m:
66 continue
67 name = m.group(1)
68 if name.startswith("_"):
69 continue
70 fns.append(name)
71 if fns:
72 out[module] = sorted(set(fns))
73 return out
74
75
76def as_ts(rust_api: dict[str, list[str]], python_api: dict[str, list[str]]) -> str:
77 payload = {
78 "generatedAt": "generated-by-scripts/generate_api_inventory.py",
79 "rust": rust_api,
80 "python": python_api,
81 }
82 body = json.dumps(payload, indent=2, sort_keys=True)
83 return "// Generated file. Do not edit manually.\nexport const apiInventory = " + body + " as const;\n"
84
85
86def main() -> int:
87 parser = argparse.ArgumentParser(description="Generate docs-site API inventory snapshot")
88 parser.add_argument("--check", action="store_true", help="Fail if generated output differs")

Callers 1

Calls 3

scan_rustFunction · 0.85
scan_pythonFunction · 0.85
as_tsFunction · 0.85

Tested by

no test coverage detected