CodeQL library for Python
codeql/python-all 0.12.0 (changelog, source)

Predicate API::moduleImport

Gets a node corresponding to an import of module m.

Note: You should only use this predicate for top level modules. If you want nodes corresponding to a submodule, you should use .getMember on the parent module. For example, for nodes corresponding to the module, use moduleImport("foo").getMember("bar").

Import path

import semmle.python.ApiGraphs
Node moduleImport(string m)