Skip to content
Back to top
View this page
Edit this page

# xonsh.completers.imports

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)

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

xonsh.completers.imports.complete_module(prefix)

xonsh.completers.imports.filter_completions(prefix, completions)

xonsh.completers.imports.get_root_modules()

  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)

xonsh.completers.imports.is_possible_submodule(module, attr)

xonsh.completers.imports.module_list(path)

  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]

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