Skip to content

Latest commit

 

History

History
138 lines (86 loc) · 4.73 KB

README.md

File metadata and controls

138 lines (86 loc) · 4.73 KB

🌅 Command-Line File Comparison Tool

Actions Status Maintainability Test Coverage LinkedIn Icons8


🗞️ Description

'gendiff' can make a difference!

It's a command-line application that compares two files and generates the difference between them. The application supports files in JSON and YAML formats and provides three output formats for displaying the differences: stylish, plain, and json.


⚙️ Features

  • File Comparison: Compares two files and identifies the differences between them.

  • Supported Formats: Works with files in JSON and YAML(YML) formats.

  • Output Formats: Displays the differences in three different formats:

    • Stylish: A nested format that shows the differences in a hierarchical structure.
    • Plain: A plain text format that shows the differences in a straightforward, linear way.
    • JSON: A format that outputs the differences as a JSON object.

🔌 Installation

It is recommended to use a virtual environment

  1. Well, this is how you can start the virtual environment (let's call it, for example, bubble) if you have Python3 installed.
python3 -m venv bubble
source bubble/bin/activate
  1. Clone the repository and then go into it:
git clone [email protected]:himetik/python-project-50.git
cd python-project-50
  1. Install the app with just one command:
make run

🕹️ Use 'gendiff' to Compare Two JSON/YAML Files

By default, the files are compared in the "stylish" format

Flat comparison:

gendiff -f first_flat.json second_flat.json

Compare 2 JSON files.

Stylish Format:

Displays the differences in a human-readable format.

gendiff -f stylish first.yaml second.yml

Compare 2 JSON files.

Plain Format:

Shows the differences in a plain text format.

gendiff -f plain first.json second.json

Compare 2 JSON files.

JSON Format:

Outputs the differences in JSON.

gebdiff -f json first.json first.yaml

Compare 2 JSON files.


🛠️ Tools and Technologies Used

The project utilizes a variety of tools and technologies to enhance development and maintain code quality:

Git Git is a distributed version control system used for managing source code changes and collaboration.

Bash Bash serves as a Unix shell and command language, essential for scripting and automation tasks in development environments.

Python Python is employed as a high-level programming language, valued for its simplicity and readability, making it a preferred choice for various programming tasks.

VSCode VSCode is the source-code editor of choice, offering robust support for debugging, syntax highlighting, and many other features that streamline coding and development.

🔩 Poetry is used as a dependency management and packaging tool specifically designed for Python projects, facilitating easy management of project dependencies and packaging.

🧪 pytest is the testing framework adopted for writing simple and scalable test cases in Python, ensuring code reliability and correctness through comprehensive testing.

🎥 asciinema is a tool used for recording and sharing terminal sessions, enabling you to capture and replay terminal interactions.


🛰️ Project Version and Dependencies

Project version: 0.1.0

The project requires the following dependencies:

Python: ^3.10
PyYAML: ^6.0

For development and testing, the following packages are used:

pytest: ^7.2.0
ipython: ^8.8.0
pytest-cov: ^4.0.0
flake8: ^6.0.0
isort: ^5.11.4