line_profiler.autoprofile.profmod_extractor module¶
- class line_profiler.autoprofile.profmod_extractor.ProfmodExtractor(tree: Module, script_file: str, prof_mod: list[str])[source]¶
Bases:
objectMap prof_mod to imports in an abstract syntax tree.
Takes the paths and dotted paths in prod_mod and finds their respective imports in an abstract syntax tree.
Initializes the AST tree profiler instance with the AST, script file path and prof_mod
- Parameters:
tree (_ast.Module) – abstract syntax tree to fetch imports from.
script_file (str) – path to script being profiled.
prof_mod (List[str]) – list of imports to profile in script. passing the path to script will profile the whole script. the objects can be specified using its dotted path or full path (if applicable).