tessl install tessl/pypi-comtypes@1.4.0Pure Python COM package for Windows COM automation and interoperability
Agent Success
Agent success rate when using this tile
88%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.99x
Baseline
Agent success rate without this tile
89%
A utility for inspecting COM type libraries and extracting metadata about interfaces, enumerations, and structures defined within them.
@generates
The implementation should provide a class that encapsulates type library inspection functionality. The class should handle loading type libraries and provide methods to query various aspects of the type information.
class TypeLibInspector:
"""
Inspector for COM type libraries that extracts metadata and type information.
"""
def __init__(self, typelib_path: str):
"""
Initialize the inspector with a type library file path.
Args:
typelib_path: Path to the type library file (.tlb, .dll, or .exe)
Raises:
FileNotFoundError: If the type library file does not exist
OSError: If the type library cannot be loaded
"""
pass
def get_typelib_info(self) -> dict:
"""
Get basic information about the type library.
Returns:
Dictionary containing:
- 'name': Type library name
- 'version': Version as tuple (major, minor)
- 'doc': Documentation string
- 'helpfile': Help file path (if available)
"""
pass
def get_type_names(self) -> list:
"""
Get names of all types defined in the type library.
Returns:
List of type names (interfaces, enums, structures, etc.)
"""
pass
def get_interface_info(self, interface_name: str) -> dict:
"""
Get detailed information about a specific interface.
Args:
interface_name: Name of the interface to inspect
Returns:
Dictionary containing:
- 'name': Interface name
- 'methods': List of method names
- 'doc': Interface documentation string
Raises:
ValueError: If interface_name is not found in the type library
"""
passProvides COM interoperability and type library access.
The test file should be named test_typelib_inspector.py following Python conventions and should test: