Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hexlet tests and linter status:

Actions Status Actions Status Maintainability Test Coverage

Package description

Compare two .JSON and/or .YAML (.YLM) files: check updates in file contents, if any.

Output formats

Get data difference between two files in three available output formats:
  1. stylish,

  2. plain,

  3. json.

STYLISH

Default format.

gendiff path/to/file1 path/to/file2

Data difference description keys:

Key Meaning
+ key-value pair is present only in the second file
- key-value pair is present only in the first file
space key-value pair is present in the both files

PLAIN

A plain descriptive format with only changed key-value pairs shown.

gendiff -f plain path/to/file1 path/to/file2

Property "SomeProperty" was removed

Property "SomeProperty" was added with value: "SomeValue"

Property "SomeProperty" was updated. From Value1 to Value2

If a value is a dictionary, it is displayed as "[complex value]".

JSON

A usual json format.

gendiff -f json path/to/file1 path/to/file2

Installation

pip install git+https://github.com/Maroosha/python-project-lvl2.git

Help and usage

gendiff -h

gendiff --format path/to/file1 path/to/file2

Demo

Compare two flat JSON and/or YAML files: stylish format

asciicast

Compare two nested JSON and/or YAML files: stylish format

asciicast

Compare two JSON and/or YAML files: plain format

asciicast

Compare two JSON and/or YAML files: json format

asciicast

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages