Skip to content

Pythonusus/python-project-50

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project logo

GenDiff

Hexlet tests, CI tests, maintainability, test coverage status:

Actions Status Actions Status Maintainability Test Coverage

📝 Table of Contents

🧐 About

GenDiff is a command-line utility that compares two JSON or YAML files and generates a difference.

GenDiff supports different formats of output such as TXT, JSON or YAML.

You can also use GenDiff as a library or dependency to your project.

🏁 Getting Started

Prerequisites

  1. Python >= 3.12
  2. pip >= 23.3.1
  3. Poetry >= 1.7.1

Installing

  1. Clone GitHub repo:
git clone https://github.com/Pythonusus/python-project-50
  1. Create virtual environment and install dependencies. This comman should be executed in the root directory of the project:
make install
  1. Build project:
make build
  1. Install project on user level (home/<user-name>/.local/bin for Linux users):
make package-install
  1. If you receive a warning on step 4: WARNING: The script gendiff is installed in 'path/to/your/executable' which is not on PATH. add this directory to PATH for current shell session:
export PATH=$PATH:'path/to/your/executable'

To set it permanently for all future bash sessions add export PATH=$PATH:'path/to/your/executable' to your .bashrc file in your $HOME directory.

  1. GenDiff is ready to use!

Installation example:

asciicast

🎈 Usage

gendiff command will become available in the command line after installation

To compare two JSON or YAML files use:

gendiff path/to/file1 path/to/file2

You can set format of the output using -f or --format flag

Available formats:

  • stylish (default)
  • plain
  • json
  • yaml
gendiff path/to/file1 path/to/file2 -f plain

Stylish format example for plain structures:

asciicast

Stylish format example for nested structures:

asciicast

Plain format example:

asciicast

Json format example:

asciicast

Yaml format example:

asciicast

To see help use -h or --help flag

gendiff -h

⛏️ Built Using

  • Poetry - Python packaging and dependency management tool
  • PyYAML - A full-featured YAML framework for the Python programming language

✍️ Authors

@Pythonusus

Logo

Made with Ideogram AI

Stored at imgur.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published