get_function_source
Retrieve the full source code of any function from an Industrial Ecology Python package's GitHub repository, optionally at a specific version tag.
Instructions
Find a function in the package's GitHub source code and return its full source, including docstring and signature.
Searches the repository for files containing the function name, then uses Python's ast module to extract the exact function definition. The raw source file is cached locally after the first fetch.
If a version is given, the file is fetched at that GitHub tag. Call list_source_versions(package) first to confirm the version tag exists.
Only returns an error if the version tag does not exist, or if the function was not present in the codebase at that version.
Args: package: Package name as returned by list_packages(). function_name: Exact name of the function or method to retrieve. version: Optional version tag (e.g. 'v2.1.0' or '2.1.0'). Omit to get the current (latest) implementation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| package | Yes | ||
| version | No | ||
| function_name | Yes |