Skip to content

Pejnikov/python-project-lvl2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Difference Generator

Actions Status Project tests Maintainability Test Coverage

🧨 Key Features

  • Supports formats: '.json' and '.yaml'/'.yml';
  • Supports two native ouput formats: Plain, Stylish (default);
  • Has special JSON ouput.

🛠 Installation and Running

Package:

$ python3 -m pip install --user hexlet-code
$ gendiff filepath1 filepath2

Library:

from gendiff import generate_diff

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

🪄 Quick Example

$ cat file1 file2
{
    "unmodified": "health",
    "removed": "time",
    "updated": "1000$"
}
{
    "unmodified": "health",
    "added": "knowledge",
    "updated": "10000$"
}
$ gendiff file1 file2
{
  + added: knowledge
  - removed: time
    unmodified: health
  - updated: 1000$
  + updated: 10000$
}
$ gendiff file1 file2 -f plain
Property 'added' was added with value: 'knowledge'
Property 'removed' was removed
Property 'updated' was updated. From '1000$' to '10000$'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published