Skip to main content

A diff tool for checking the Yaml, Json files while developing cloud based applications

Project description

cloud-diff

yaml-json-diff - YAML & JSON Diff Tool with AI Explanations

License: MIT Last Commit PyPI

yaml-json-diff is a Python CLI tool and library based on DeepDiff for computing the difference between YAML and JSON files. It also offers optional AI-powered explanations of the diffs using local language models via Ollama.


Features

  • Compare two .yaml, .yml, or .json files
  • Human-readable or JSON-formatted diff outputs
  • Optional AI-generated summary of changes (--explain) using LLMs like Mistral, LLaMA via Ollama
  • Clean CLI interface via Typer
  • Docker support

Installation

From PyPI

pip install yaml-json-diff

From GitHub (latest)

pip install git+https://github.com/pooya-rostami/yaml-json-diff.git

Poetry (local dev)

git clone https://github.com/pooya-rostami/yaml-json-diff.git
cd yaml-json-diff
poetry install --only main

Usage

CLI

yaml-json-diff FILE1 FILE2 [OPTIONS]

Options:

Option Description
--explain, -e Generate an AI explanation of the diff using a local LLM (via Ollama)
--model, -m Model to use for explanation (default: mistral)

Examples

Basic diff:

yaml-json-diff config-v1.yaml config-v2.json

With AI Explanation:

yaml-json-diff config-old.json config-new.json --explain

Using a Custom Ollama Model:

yaml-json-diff file1.yaml file2.yaml --explain --model llama3

AI Support via Ollama

To use the --explain feature:

  1. Install Ollama from https://ollama.com

  2. Ensure Ollama is running:

ollama run mistral
  1. Use the --explain flag in the CLI

By default, the tool uses the mistral model. You can switch to another model like llama3, codellama, etc.


Contributions

Contributions are very welcome! Feel free to report bugs or suggest new features using GitHub issues and/or pull requests.


License

This tool is distributed under GNU Lesser General Public License v3.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloud_diff-0.1.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloud_diff-0.1.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file cloud_diff-0.1.0.tar.gz.

File metadata

  • Download URL: cloud_diff-0.1.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.4 Darwin/24.5.0

File hashes

Hashes for cloud_diff-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a011e3f4ced671f33c4649375072f2d05850ec5815ff57a7ec69276f592be5c3
MD5 7605199a487b710a608b67bf38548fb5
BLAKE2b-256 d996fa3779a8c23ab1aca764ee30a063ca06eb0c0d7bc9577e390f7b59e2043d

See more details on using hashes here.

File details

Details for the file cloud_diff-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cloud_diff-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.4 Darwin/24.5.0

File hashes

Hashes for cloud_diff-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b002f11f9ca7471447c1d934c0ce284b30ff79d559423c21f2f2f4963aad782
MD5 d5a3d65521956ef8f1a63d05eadf96ce
BLAKE2b-256 8aa505617159390617481f1cf040e14bf0c51fd829471d26bc34ba564ce1c740

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page