from os import scandir, path
from tree import Tree

def path_to_tree(path_name:str)->Tree:
    return Tree((path_name,[f.name for f in scandir(path_name)]),
                [path_to_tree(path.join(path_name, f.name))
                 for f in scandir(path_name)
                 if f.is_dir()])
