"Gendiff" is a program that determines the difference between two data structures.
Features of the utility:
- Supports different input formats: yaml (yml), json
- Report generation as plain text, stylish and json
Tool | Version |
---|---|
python | "^3.8.1" |
PyYAML | "^6.0" |
Before installation, make sure that you have Poetry installed.
- Clone the repository to your computer
git clone https://github.com/ratushnyyvm/gendiff.git
- Go to the project folder
cd gendiff
- Install the program
make setup
$ gendiff -h
usage: gendiff [-h] [-f {stylish,plain,json}] first_file second_file
Compares two configuration files and shows a difference.
positional arguments:
first_file
second_file
optional arguments:
-h, --help show this help message and exit
-f {stylish,plain,json}, --format {stylish,plain,json}
set format of output (default: "stylish")
from gendiff import generate_diff
diff = generate_diff(file_path1, file_path2)
print(diff)
stylish
gendiff path/to/file1 path/to/file2
gendiff path/to/file1 path/to/file2 -f stylish
gendiff path/to/file1 path/to/file2 --format stylish
plain
gendiff path/to/file1 path/to/file2 -f plain
gendiff path/to/file1 path/to/file2 --format plain