SharedLibrary

method_type: SharedLibraryFunction

 

__init__(self, library, **functions): 

LLM Docstring

Create a shared-library facade and optionally register functions from configuration dictionaries.

  • library: str | ctypes.CDLL | SharedLibraryLoader

    library path, handle, or loader

  • functions: dict[str, dict]

    registration options keyed by exposed attribute name

  • :returns: None

    no value is returned

 

register(self, tag, name=None, docstring=None, defaults=None, return_handler=None, prep_args=None, **params): 

LLM Docstring

Register and return a callable wrapper for one library function.

The exposed tag may differ from the native function name; remaining keyword parameters define the FunctionSignature arguments.

  • tag: str

    lookup name stored in the facade

  • name: str | None

    native symbol name, defaulting to tag

  • docstring: str | None

    optional function documentation

  • defaults: dict | None

    argument defaults

  • return_handler: Callable | None

    raw-result postprocessor

  • prep_args: Callable | None

    keyword-argument preprocessing callback

  • params: dict[str, Any]

    argument names mapped to type specifications

  • :returns: SharedLibraryFunction

    registered function wrapper

 

get_function(self, item): 

LLM Docstring

Retrieve a registered function wrapper by tag.

  • item: str

    registered function tag

  • :returns: SharedLibraryFunction

    registered wrapper

 

__getattr__(self, item): 

LLM Docstring

Resolve missing attributes as registered function tags.

  • item: str

    attribute name

  • :returns: SharedLibraryFunction

    registered wrapper

 

__repr__(self): 

LLM Docstring

Return a representation of the library facade.

The current formatting expression passes a generator to str.format without a placeholder and therefore does not list the registered signatures.

  • :returns: str

    representation string


Feedback

Examples

Templates

Documentation