Skip to content

About

This is the second of four training projects on the Python Software Developer course on Hexlet.io

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

128 Commits

Folders and files

Repository files navigation

Generate diff

Github Actions Status wemake-python-styleguide Maintainability Test Coverage

Gendiff is a CLI utility for finding differences between configuration files.

Features

  • Suppported formats: YAML, JSON
  • Report generation as plain text, structured text or JSON
  • Can be used as CLI tool or external library

Usage

As external library

from gendiff import generate_diff

diff = generate_diff(filepath1, filepath2)

As CLI tool

> gendiff --help
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

Installation

pip install --user --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ altvec-gendiff

asciicast

Comparing flat JSON files

gendiff simple_before.json simple_after.json

If format option is omitted, output will be in string by default.

asciicast

Comparing files with nested structures

gendiff -f string complex_before.json complex_after.json

asciicast

Plain text format for output

gendiff -f plain before.json after.json

asciicast

About

This is the second of four training projects on the Python Software Developer course on Hexlet.io

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages