{"library":"griffelib","code":"import os\nfrom griffe.loader import GriffeLoader\nfrom griffe.dataclasses import Module, Class, Function\nfrom pathlib import Path\n\n# Create a dummy Python module for demonstration\ndummy_module_code = \"\"\"\ndef my_function(param1: str, param2: int) -> bool:\n    \"\"\"A sample function.\"\"\"\n    return len(param1) == param2\n\nclass MyClass:\n    \"\"\"A sample class.\"\"\"\n    def __init__(self, name: str):\n        self.name = name\n\n    def get_name(self) -> str:\n        \"\"\"Returns the name.\"\"\"\n        return self.name\n\"\"\"\n\n# Create a temporary directory and file for the dummy module\n# In a real scenario, you would load an existing module\ntmp_dir = Path(\"./_griffelib_temp_module\")\ntmp_dir.mkdir(exist_ok=True)\ndummy_file = tmp_dir / \"dummy_example.py\"\ndummy_file.write_text(dummy_module_code)\n\n# Initialize the Griffe loader and load the module\nloader = GriffeLoader()\nloaded_module: Module = loader.load_module(\"dummy_example\", search_paths=[tmp_dir])\n\nprint(f\"Module name: {loaded_module.name}\")\n\n# Iterate through members (functions, classes)\nfor member in loaded_module.members.values():\n    if isinstance(member, Function):\n        print(f\"  Function: {member.name}\")\n        print(f\"    Signature: {member.signature}\")\n        print(f\"    Docstring: {member.docstring.value if member.docstring else 'N/A'}\")\n    elif isinstance(member, Class):\n        print(f\"  Class: {member.name}\")\n        print(f\"    Docstring: {member.docstring.value if member.docstring else 'N/A'}\")\n        for method in member.members.values():\n            if isinstance(method, Function):\n                print(f\"      Method: {method.name}\")\n                print(f\"        Signature: {method.signature}\")\n\n# Clean up temporary directory (optional)\nimport shutil\nshutil.rmtree(tmp_dir)\n","lang":"python","description":"This quickstart demonstrates how to use `griffelib` (specifically, components from the `griffe` package) to load a Python module from a file path, access its members, and extract signature and docstring information. It involves creating a dummy module, loading it with `GriffeLoader`, and then navigating the resulting `Module` object to inspect its contents.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}