Skip to content

This is the second project implemented for educational purposes in the learning process on the Hexlet study platform

License

Notifications You must be signed in to change notification settings

IDilettant/gendiff

Repository files navigation

Gendiff

Actions Status Maintainability Test Coverage Actions Status wemake-python-styleguide

Description

Gendiff (GENerator of DIFFerences) - a program defining the difference between two data structures (JSON and/or YAML) and generating new structure containing differences details (including unchanged).

This is the second project implemented for educational purposes in the learning process on the Hexlet study platform

Features

  • Supported input formats: YAML, JSON
  • Report generation as plain text, structured text and JSON
  • Usage as CLI util or library function

Quickstart

pip install git+https://github.com/IDilettant/python-project-lvl2.git

Usage

As library function

from gendiff import generate_diff

diff = generate_diff(first_file_path, second_file_path, formatter)

As CLI utility

$ 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')

Usage examples

Stylish formatter output (-f stylish):

asciicast

Plain formatter output (-f plain):

asciicast

Json formatter output (-f json):

asciicast

About

This is the second project implemented for educational purposes in the learning process on the Hexlet study platform

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published