Skip to content

manifest

Read tool metadata from 3dbag-manifest.json.

get_tool_metadata(tool_name)

Return a single tool's entry from the manifest.

Source code in packages/common/src/bag3d/common/utils/manifest.py
64
65
66
67
68
69
70
def get_tool_metadata(tool_name: str) -> dict:
    """Return a single tool's entry from the manifest."""
    manifest = load_manifest()
    tools = manifest.get("tools", {})
    if tool_name not in tools:
        raise KeyError(f"Tool '{tool_name}' not found in manifest")
    return tools[tool_name]

load_manifest()

Parse and return the full manifest, cached after first call.

Source code in packages/common/src/bag3d/common/utils/manifest.py
54
55
56
57
58
59
60
61
def load_manifest() -> dict:
    """Parse and return the full manifest, cached after first call."""
    global _manifest_cache
    if _manifest_cache is None:
        path = _find_manifest()
        _manifest_cache = json.loads(path.read_text(encoding="utf-8"))
    assert _manifest_cache is not None
    return _manifest_cache