Skip to content

Gendiff is the Difference Generator is a program that looks for differences between two files.

Notifications You must be signed in to change notification settings

sudobooo/gendiff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python CI Maintainability Test Coverage

Gendiff

The second project written for the academic purposes of a Hexlet's course on learning a programming language Python.

About the project

Gendiff is the Difference Generator is a program that looks for differences between two files.

  • Suppported formats: YAML, JSON
  • The following output formats are available: json, plaind and stylish
  • Can be used as CLI tool or library

How to install and use

Install

python3 -m pip install git+https://github.com/sudobooo/python-project-lvl2

Use as a library

from gendiff import generate_diff

diff = generate_diff(file_path1, file_path2, format_name)
print(diff)

Default argument for format format_name='stylish'

Use as a CLI

gendiff -h
usage: gendiff [-h] [-f FORMAT] first_file second_file

Generate diff

positional arguments:
  first_file
  second_file

optional arguments:
  -h, --help            show this help message and exit
  -f FORMAT, --format FORMAT
                        set format of output

Demonstration of the program

Asciinema format stylish for flat json files

asciicast

Asciinema format stylish for flat yaml files

asciicast

Asciinema format stylish for json and yaml files has nested structures

asciicast

Asciinema format plain for json and yaml files has nested structures

asciicast

Asciinema format json for json files has nested structures

asciicast

About

Gendiff is the Difference Generator is a program that looks for differences between two files.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published