- class astroid.nodes.ImportFrom(fromname: str | None, names: list[tuple[str, str | None]], level: int | None = 0, lineno: int | None = None, col_offset: int | None = None, parent: NodeNG | None = None, *, end_lineno: int | None = None, end_col_offset: int | None = None)#
Class representing an
>>> import astroid >>> node = astroid.extract_node('from my_package import my_module') >>> node <ImportFrom l.1 at 0x7f23b2e415c0>
- level: int | None#
The level of relative import.
Essentially this is the number of dots in the import. This is always 0 for absolute imports.