Skip to content

A difference generator is a program that determines the difference between two data structures.

Notifications You must be signed in to change notification settings

NNbaur/python-project-lvl2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tests and linter status:

Actions Status Actions Status

Description


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

How to install


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

Usage


As external library

from gendiff.diff_builder.generate_diff import generate_diff

diff = generate_diff(filepath1, filepath2, style)

# style: stylish - default, plain, json

As CLI tool

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

Formats

--format stylish - default
--format plain
--format json

How to work gendiff function


Comparing of two json files:

asciicast

Comparing of two YAML files:

asciicast

Complicated tree structure(format - stylish):

asciicast

Complicated tree structure(format - plain):

asciicast

Complicated tree structure(format - json):

asciicast

About

A difference generator is a program that determines the difference between two data structures.

Resources

Stars

Watchers

Forks

Packages

No packages published