Import statement completions. Contains modified code from the IPython project (at core/completerlib.py).

# Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License.

xonsh.completers.imports.complete_import(context: CompletionContext)[source]

Completes module names and objects for “import …” and “from … import …”.

xonsh.completers.imports.filter_completions(prefix, completions)[source]

Returns a list containing the names of all the modules available in the folders of the pythonpath.

xonsh.completers.imports.is_importable(module, attr, only_modules)[source]
xonsh.completers.imports.is_possible_submodule(module, attr)[source]

Return the list containing the names of the modules available in the given folder.

xonsh.completers.imports.try_import(mod: str, only_modules=False) list[str][source]

Try to import given module and return list of potential completions.