Gendiff (GENerator of DIFFerences) - a program defining the difference between two data structures (JSON or YAML) and generating new structure containing differences details (including unchanged).
- Supported input formats: YAML, JSON
- Report generation as plain text, structured text and JSON
- Usage as CLI util or library function
Use the package manager pip to install gendiff.
pip install --user git+https://github.com/AABur/python-project-lvl2.git
Installation and usage example
from gendiff import generate_diff
diff = generate_diff(file_path1, file_path2, style)
print(diff)
❯ gendiff -h
usage: gendiff [-h] [-f {json,plain,stylish}] first_file second_file
Generate difference of two JSON or YAML files.
positional arguments:
first_file first file to compare
second_file second file to compare
optional arguments:
-h, --help show this help message and exit
-f {json,plain,stylish}, --format {json,plain,stylish}
set output format (default: 'stylish')
This is a learning project and the contribution is not accepted.