scanner¶
Scanner to find all functions in a Python package.
FunctionInfo ¶
FunctionInfo(
function: Callable,
module_name: str,
function_name: str,
docstring: str | None = None,
)
Information about a function to generate a model for.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
function
|
Callable
|
The function object |
required |
module_name
|
str
|
Name of the module containing the function |
required |
function_name
|
str
|
Name of the function |
required |
docstring
|
str | None
|
Function docstring (if available) |
None
|
Source code in src/mcpup/scanner.py
scan_package ¶
scan_package(
package_name: str,
include_private: bool = False,
include_modules: list[str] | None = None,
) -> list[FunctionInfo]
Scan a package and return all functions found within it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package_name
|
str
|
Name of the package to scan |
required |
include_private
|
bool
|
Whether to include private functions (starting with underscore) |
False
|
include_modules
|
list[str] | None
|
Specific modules to include (default: all modules) |
None
|
Returns:
| Type | Description |
|---|---|
list[FunctionInfo]
|
List of FunctionInfo objects for all functions found |