Andrey-Volkovitskiy / json-yaml-comparison

2-nd project. App compares two files (JSON or YAML) and shows the difference between them.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Difference Calculator

This is the 2nd training project of "Python Developer" specialization.

The app compares two files (JSON or YAML) and shows the difference between them.

  • Implemented data abstraction and tree data structures processing
  • Practiced TDD through Pytest and parameterized fixtures
  • Implemented 3 different output options

Tests and code quality assessment:

Lint Pytest

Maintainability Test Coverage

This project was built using these tools:

Tool Description
Poetry Python dependency management and packaging
Pytest Python testing framework
Flake8 Linter to check the style of the code
Code Climate Checks code quality standards on every commit
GitHub Actions Continuous Integration (CI)

Usage options:

  • gendiff path/to/file_1 path/to/file_2 - shows the difference in nested text format
  • gendiff --format plain path/to/file_1 path/to/file_2 - shows the difference in plain text format
  • gendiff --format json path/to/file_1 path/to/file_2 - shows the difference in JSON format

Example output (in plain text format):

    Property 'follow' was removed
    Property 'timeout' was updated. From 50 to [complex value]
    Property 'verbose' was added with value: True

Example output (in nested text format):

{
  - follow: False
  - timeout: 50
  + timeout: {
        host: hexlet
        proxy: myprox
    }
    + verbose: True
}

Installation and running

You can install the application using the following commands:

  • make install - to install the required dependencies
  • make package-install - to install the application itself

Asciinema recordings

Show how the application interacts with a user:

  1. Flat JSON comparison
  2. Flat YAML comparison
  3. Nested comparison
  4. Plain format output
  5. JSON format output

About

2-nd project. App compares two files (JSON or YAML) and shows the difference between them.


Languages

Language:Python 98.2%Language:Makefile 1.8%