tooluniverse.medlineplus_tool module¶
- class tooluniverse.medlineplus_tool.BaseTool(tool_config)[source][source]¶
Bases:
object
- classmethod get_default_config_file()[source][source]¶
Get the path to the default configuration file for this tool type.
This method uses a robust path resolution strategy that works across different installation scenarios:
Installed packages: Uses importlib.resources for proper package resource access
Development mode: Falls back to file-based path resolution
Legacy Python: Handles importlib.resources and importlib_resources
Override this method in subclasses to specify a custom defaults file.
- Returns:
Path or resource object pointing to the defaults file
- tooluniverse.medlineplus_tool.register_tool(tool_type_name=None, config=None)[source][source]¶
Decorator to automatically register tool classes and their configs.
- Usage:
@register_tool(‘CustomToolName’, config={…}) class MyTool:
pass
- class tooluniverse.medlineplus_tool.MedlinePlusRESTTool(tool_config)[source][source]¶
Bases:
BaseTool
MedlinePlus REST API tool class. Supports health topic search, code lookup, genetics information retrieval, etc.
- search_topics_by_keyword(term: str, db: str, rettype: str = 'brief') Dict[str, Any] [source][source]¶