CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-comtypes

Pure Python COM package for Windows COM automation and interoperability

88

0.98x
Overview
Eval results
Files

task.mdevals/scenario-8/

COM Type Library Wrapper Generator

Build a utility that generates Python wrapper modules from COM type libraries and provides information about the generated wrappers.

Capabilities

Generate Python wrappers from type libraries

  • Given a path to a type library file (.tlb, .dll, or .exe), the tool generates a Python wrapper module and returns the generated module object. @test
  • When generating from the same type library multiple times, the tool reuses the cached wrapper instead of regenerating. @test
  • Given an invalid or non-existent type library path, the tool raises an appropriate error. @test

Inspect wrapper module contents

  • The tool can list all interface names defined in a generated wrapper module. @test

Implementation

@generates

API

def generate_wrapper(typelib_path: str):
    """
    Generate or retrieve a Python wrapper module from a COM type library.

    Args:
        typelib_path: Path to a type library file (.tlb, .dll, or .exe)

    Returns:
        The generated/cached Python module object containing wrapper classes

    Raises:
        Exception: If the type library cannot be loaded or processed
    """
    pass

def get_interfaces(wrapper_module) -> list[str]:
    """
    Extract all interface names from a generated wrapper module.

    Args:
        wrapper_module: A Python module object generated from a type library

    Returns:
        List of interface names (as strings) defined in the module,
        sorted alphabetically
    """
    pass

Dependencies { .dependencies }

comtypes { .dependency }

Provides COM interoperability and type library integration support.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-comtypes

tile.json