treecomp package

Compare directory trees and output unified diff

Submodules

treecomp.cli module

class treecomp.cli.OutputFormat(value)[source]

Bases: str, Enum

An enumeration.

JSON = 'json'
TEXT = 'text'
treecomp.cli.cli_diff_file_trees(dir1=typer.Argument, dir2=typer.Argument, ignore=typer.Option, target=typer.Option, output_format=typer.Option)

Compare two directories and print a unified diff

treecomp.fs_utils module

treecomp.fs_utils.list_path_filter_by_matchers(dir, ignore_matcher, target_matcher, include_files=True, include_dirs=True, root=PosixPath('.'))[source]
Return type:

List[str]

treecomp.ignore module

treecomp.ignore.parse_ignore_list_into_matcher(ignore_list=None)[source]
Return type:

Callable[[Union[str, Path], Path], bool]

treecomp.main module

class treecomp.main.FileDiff(path, left, right, diff)[source]

Bases: object

__init__(path, left, right, diff)
dict()[source]
Return type:

dict

diff: str
json(indent=None)[source]
Return type:

str

left: bool
path: Path
right: bool
class treecomp.main.FileTreeComparison(dir1, dir2, diffs)[source]

Bases: object

__init__(dir1, dir2, diffs)
diff_for(path)[source]
Return type:

Optional[FileDiff]

diffs: List[FileDiff]
dir1: Path
dir2: Path
json(indent=None)[source]
Return type:

str

treecomp.main.diff_file_trees(dir1, dir2, ignore=None, target=None)[source]

Compare two folders recursively, returning diffs of files that have differing content

Return type:

FileTreeComparison

treecomp.path_matcher module

treecomp.path_matcher.parse_list_into_file_matcher(pattern_list=None)[source]
Return type:

Callable[[Union[str, Path], Path], bool]

treecomp.target module

treecomp.target.parse_target_list_into_matcher(target_list=None)[source]
Return type:

Callable[[Union[str, Path], Path], bool]

treecomp.unidiff module