A difference generator is a program that determines the difference between two data structures.
Utility features:
- Support for different input formats: yaml, json
- Report generation in the form of plain text, stylish and json
pip install git+https://github.com/NNbaur/python-project-lvl2.git
or
$ git clone https://github.com/NNbaur/python-project-lvl2
$ cd ProjectDirectory
$ make install
$ make build
$ make package-install
from gendiff.diff_builder.generate_diff import generate_diff
diff = generate_diff(filepath1, filepath2, style)
# style: stylish - default, plain, json
gendiff -h
usage: gendiff [-h] [-f FORMAT] 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 FORMAT, --format FORMAT
set format of output
--format stylish - default
--format plain
--format json
Comparing of two json files:
Comparing of two YAML files:
Complicated tree structure(format - stylish):
Complicated tree structure(format - plain):
Complicated tree structure(format - json):