Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Notifications You must be signed in to change notification settings

altvec/python-project-lvl2

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

128 Commits
128 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  
Morty Proxy This is a proxified and sanitized view of the page, visit original site.