Skip to content

Latest commit

 

History

History
65 lines (50 loc) · 2.36 KB

README.md

File metadata and controls

65 lines (50 loc) · 2.36 KB

Difference Generator


Hexlet tests and linter status:

python-ci hexlet-check Maintainability Test Coverage


Installation

pip3 install --upgrade git+https://github.com/mnogom/python-project-lvl2.git

Usage

  1. From command line
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
  1. From python
import gendiff

style = "plain"  # ["stylish (default)" | "plain" | "json"]
output = gendiff.generate_diff("path/to/file1", "path/to/file2", style)

Features

  1. Works with JSON and YAML format
  2. Works with Plain and Recursive file structures
  3. Output in Stylish, Plain and JSON formats

See examples below


Examples

Plain JSON @ Stylish format

asciicast

Plain YAML @ Stylish format

asciicast

Recursive JSON @ Stylish format

asciicast

Recursive JSON @ Plain format

asciicast

Recursive JSON @ JSON format

asciicast