MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / list_functions

Function list_functions

src/ifcedit/ifcedit/discover.py:70–93  ·  view source on GitHub ↗

List functions in an API module with one-line descriptions and parameter info. Returns a list of dicts: [{"name": "create_entity", "description": "...", "params": [...]}]

(module: str)

Source from the content-addressed store, hash-verified

68
69
70def list_functions(module: str) -> list[dict]:
71 """List functions in an API module with one-line descriptions and parameter info.
72
73 Returns a list of dicts: [{"name": "create_entity", "description": "...", "params": [...]}]
74 """
75 mod = importlib.import_module(f"ifcopenshell.api.{module}")
76 all_names = getattr(mod, "__all__", [])
77 functions = []
78 for name in all_names:
79 fn = _get_underlying_function(module, name)
80 if fn is None:
81 continue
82 description = ""
83 if fn.__doc__:
84 description = fn.__doc__.strip().split("\n")[0]
85 params = _extract_params(fn)
86 functions.append(
87 {
88 "name": name,
89 "description": description,
90 "params": params,
91 }
92 )
93 return functions
94
95
96def function_docs(module: str, function: str) -> dict:

Callers 6

ifc_listMethod · 0.90
test_root_functionsMethod · 0.90
test_pset_functionsMethod · 0.90
cmd_listFunction · 0.90

Calls 4

_get_underlying_functionFunction · 0.85
_extract_paramsFunction · 0.85
splitMethod · 0.80
appendMethod · 0.45

Tested by 4

test_root_functionsMethod · 0.72
test_pset_functionsMethod · 0.72