module documentation

FileSystem module for Scalpel. The original import graph will be removed while the similar functionalities are implemented in this module. The purpose of this component is to support modelling large Python project structure in a simplified way. This component is still under development.

Author: Jiawei Wang

Class FileSystem This class is an upgraded implementation of import graph which will be removed in to later releases. It is a data structure that allows users to manipulate different files under a Python project. It leverage import relations in each of source files along with their absolute import name.
Class Node This is the basic unit in the FS. Each node represents a single Python module files. Module name, absolute path name, AST and source string are recorded in this dataclass. In addition, fields of its parent and childs are recorded.
Function correct_relative_import Undocumented
Function format_import_path Undocumented
Function main Undocumented
Function parse_import To parse import statements from the AST tree Args: tree: Python import statement Returns: mport path
def correct_relative_import(stmt, is_cur_package_init_file): (source)

Undocumented

def format_import_path(import_stmt, abs_path): (source)

Undocumented

def main(): (source)

Undocumented

def parse_import(tree: ast.Module) -> Dict: (source)

To parse import statements from the AST tree Args: tree: Python import statement Returns: mport path