rope.contrib.autoimport.parse ============================= .. py:module:: rope.contrib.autoimport.parse .. autoapi-nested-parse:: Functions to find importable names. Can extract names from source code of a python file, .so object, or builtin module. Attributes ---------- .. autoapisummary:: rope.contrib.autoimport.parse.logger Functions --------- .. autoapisummary:: rope.contrib.autoimport.parse.get_type_ast rope.contrib.autoimport.parse.get_names_from_file rope.contrib.autoimport.parse.get_type_object rope.contrib.autoimport.parse.get_names rope.contrib.autoimport.parse.get_names_from_compiled rope.contrib.autoimport.parse.combine Module Contents --------------- .. py:data:: logger .. py:function:: get_type_ast(node: rope.base.ast.AST) -> rope.contrib.autoimport.defs.NameType Get the lsp type of a node. .. py:function:: get_names_from_file(module: pathlib.Path, package_name: str = '', underlined: bool = False, process_imports: bool = False) -> Generator[rope.contrib.autoimport.defs.PartialName, None, None] Get all the names from a given file using ast. .. py:function:: get_type_object(imported_object) -> rope.contrib.autoimport.defs.NameType Determine the type of an object. .. py:function:: get_names(module: rope.contrib.autoimport.defs.ModuleInfo, package: rope.contrib.autoimport.defs.Package) -> List[rope.contrib.autoimport.defs.Name] Get all names from a module and package. .. py:function:: get_names_from_compiled(package: str, source: rope.contrib.autoimport.defs.Source, underlined: bool = False) -> Generator[rope.contrib.autoimport.defs.Name, None, None] Get the names from a compiled module. Instead of using ast, it imports the module. :param package: package to import. Must be in sys.path :type package: str :param underlined: include underlined names :type underlined: bool .. py:function:: combine(package: rope.contrib.autoimport.defs.Package, module: rope.contrib.autoimport.defs.ModuleFile, name: rope.contrib.autoimport.defs.PartialName) -> rope.contrib.autoimport.defs.Name Combine information to form a full name.