or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/comtypes@1.4.x
tile.json

tessl/pypi-comtypes

tessl install tessl/pypi-comtypes@1.4.0

Pure 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%

task.mdevals/scenario-9/

COM Type Library Inspector

A utility for inspecting COM type libraries and extracting metadata about interfaces, enumerations, and structures defined within them.

Capabilities

Type Library Loading

  • Loads a type library from a file path and retrieves basic information about it. @test
  • Handles invalid file paths gracefully by raising appropriate errors. @test

Type Information Extraction

  • Extracts all type names defined in a type library (interfaces, enumerations, structures). @test
  • Retrieves detailed information about a specific interface including its methods and their signatures. @test

Type Library Metadata

  • Extracts type library documentation including name, version, and help string. @test

Implementation

@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.

API

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
        """
        pass

Dependencies { .dependencies }

comtypes { .dependency }

Provides COM interoperability and type library access.

Test Requirements

The test file should be named test_typelib_inspector.py following Python conventions and should test:

  1. Loading a type library successfully
  2. Handling invalid file paths
  3. Extracting type names from the library
  4. Retrieving interface information
  5. Getting type library metadata