Skip to content

hdx.utilities.compare

module hdx.utilities.compare

File compare utilities.

Functions

  • compare_files Returns the delta between two files using -, ?, + format excluding lines that are the same.

  • assert_files_same Asserts that two files are the same and returns delta using.

compare_files(path1: Path | str, path2: Path | str, encoding: str = 'utf-8')list[str]

Returns the delta between two files using -, ?, + format excluding lines that are the same.

Parameters

  • path1 : Path | str Path to first file

  • path2 : Path | str Path to second file

Returns

  • list[str] Delta between the two files

assert_files_same(path1: Path | str, path2: Path | str, encoding: str = 'utf-8')None

Asserts that two files are the same and returns delta using.

-, ?, + format if not

Parameters

  • path1 : Path | str Path to first file

  • path2 : Path | str Path to second file

Returns

  • None None