Skip to content

Index a whole python module #23

@tazarov

Description

@tazarov

For now we should support only functions and not class methods.

Sample code:

import importlib
import inspect

def index_module(module_name: str, funtion_indexer: FunctionIndexer):
    # Import module
    module = importlib.import_module(module_name)
    functions = inspect.getmembers(module, inspect.isfunction)
    # print({fn: isinstance(f, functools.partial) for fn, f in functions})
    funtion_indexer.index_functions([f for _, f in functions])

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions