All Projects → homeport → Dyff

homeport / Dyff

Licence: mit
/ˈdʏf/ - diff tool for YAML files, and sometimes JSON

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Dyff

Cfgdiff
diff(1) all your configs
Stars: ✭ 138 (-50.18%)
Mutual labels:  json, yaml, diff
Renderer
Simple, lightweight and faster response (JSON, JSONP, XML, YAML, HTML, File) rendering package for Go
Stars: ✭ 220 (-20.58%)
Mutual labels:  json, yaml
Mashumaro
Fast and well tested serialization framework on top of dataclasses
Stars: ✭ 208 (-24.91%)
Mutual labels:  json, yaml
Config
JSON or YAML configuration wrapper with convenient access methods.
Stars: ✭ 237 (-14.44%)
Mutual labels:  json, yaml
Swagger Toolbox
💡 Swagger schema model (in yaml, json) generator from json data
Stars: ✭ 194 (-29.96%)
Mutual labels:  json, yaml
Chronicle Wire
A Java Serialisation Library that supports multiple formats
Stars: ✭ 204 (-26.35%)
Mutual labels:  json, yaml
Konf
A type-safe cascading configuration library for Kotlin/Java/Android, supporting most configuration formats
Stars: ✭ 225 (-18.77%)
Mutual labels:  json, yaml
Vcspull
🔄 synchronize projects via yaml/json manifest. built on libvcs
Stars: ✭ 187 (-32.49%)
Mutual labels:  json, yaml
Vscode Data Preview
Data Preview 🈸 extension for importing 📤 viewing 🔎 slicing 🔪 dicing 🎲 charting 📊 & exporting 📥 large JSON array/config, YAML, Apache Arrow, Avro, Parquet & Excel data files
Stars: ✭ 245 (-11.55%)
Mutual labels:  json, yaml
Cli
A simple, fast, and fun package for building command line apps in Go
Stars: ✭ 16,995 (+6035.38%)
Mutual labels:  json, yaml
Korio
Korio: Kotlin cORoutines I/O : Virtual File System + Async/Sync Streams + Async TCP Client/Server + WebSockets for Multiplatform Kotlin 1.3
Stars: ✭ 282 (+1.81%)
Mutual labels:  json, yaml
Rapidyaml
Rapid YAML - a library to parse and emit YAML, and do it fast.
Stars: ✭ 183 (-33.94%)
Mutual labels:  json, yaml
Srsly
🦉 Modern high-performance serialization utilities for Python (JSON, MessagePack, Pickle)
Stars: ✭ 189 (-31.77%)
Mutual labels:  json, yaml
Python Benedict
dict subclass with keylist/keypath support, I/O shortcuts (base64, csv, json, pickle, plist, query-string, toml, xml, yaml) and many utilities. 📘
Stars: ✭ 204 (-26.35%)
Mutual labels:  json, yaml
Autoserver
Create a full-featured REST/GraphQL API from a configuration file
Stars: ✭ 188 (-32.13%)
Mutual labels:  json, yaml
Config
📝 Go config manage(load,get,set). support JSON, YAML, TOML, INI, HCL, ENV and Flags. Multi file load, data override merge, parse ENV var. Go应用配置加载管理,支持多种格式,多文件加载,远程文件加载,支持数据合并,解析环境变量名
Stars: ✭ 225 (-18.77%)
Mutual labels:  json, yaml
Quicklib
Quick development library (AutoMapper, LinQ, IOC Dependency Injection, MemoryCache, Scheduled tasks, Config, Serializers, etc) with crossplatform support for Delphi/Firemonkey (Windows,Linux,OSX/IOS/Android) and freepascal (Windows/Linux).
Stars: ✭ 274 (-1.08%)
Mutual labels:  json, yaml
Models
WordPress plugin to create custom post types and taxonomies using JSON, YAML or PHP files
Stars: ✭ 167 (-39.71%)
Mutual labels:  json, yaml
Related
Nested Object Models in Python with dictionary, YAML, and JSON transformation support
Stars: ✭ 169 (-38.99%)
Mutual labels:  json, yaml
Thorsserializer
C++ Serialization library for JSON
Stars: ✭ 241 (-13%)
Mutual labels:  json, yaml

δyƒƒ /ˈdʏf/ License Go Report Card Build and Tests Codecov Go Reference Release

dyff

A diff tool for YAML files, and sometimes JSON

Description

dyff is inspired by the way the old BOSH v1 deployment output reported changes from one version to another by only showing the parts of a YAML file that change.

Each difference is referenced by its location in the YAML document by using either the Spruce or go-patch path syntax. The output report aims to be as compact as possible to give a clear and simple overview of the change.

Similar to the standard diff tool, it follows the principle of describing the change by going from the from input file to the target to input file.

Input files can be local files (filesystem path), remote files (URI), or the standard input stream (using -).

All orders of keys in hashes are preserved during processing and output to the terminal, most notably in the sub-commands to convert YAML to JSON and vice versa.

Installation

On macOS, dyff is available via Homebrew:

brew install homeport/tap/dyff

Prebuilt binaries for a lot of operating systems and architectures can be downloaded from the releases section.

There is a convenience script to download the latest release for Linux or macOS if you want to keep it simple (you need curl and jq installed on your machine):

curl --silent --location https://tinyurl.com/y4qvdl4d | bash

You can download and build dyff from source using go get:

GO111MODULE=on go get github.com/homeport/dyff/cmd/dyff

Use cases and examples

  • Show the differences between two versions of cf-deployment YAMLs:

    dyff between \
      https://raw.githubusercontent.com/cloudfoundry/cf-deployment/v1.10.0/cf-deployment.yml \
      https://raw.githubusercontent.com/cloudfoundry/cf-deployment/v1.20.0/cf-deployment.yml
    

    dyff between example

  • Embed dyff into Git for better understandable differences

    # Setup...
    git config --local diff.dyff.command 'dyff_between() { dyff --color on between --omit-header "$2" "$5"; }; dyff_between'
    echo '*.yml diff=dyff' >> .gitattributes
    
    # And have fun, e.g.:
    git log --ext-diff -u
    git show --ext-diff HEAD
    

    dyff between example of a Git commit

  • Convert a JSON stream to YAML

    sometool --json | jq --raw-output '.data' | dyff yaml -
    
  • Sometimes you end up with YAML or JSON files, where the order of the keys in maps was sorted alphabetically. With dyff you can restructure keys in maps to a more human appealing order:

    sometool --export --json | dyff yaml --restructure -
    

    Or, rewrite a file in place with the restructured order of keys.

    dyff yaml --restructure --in-place somefile.yml
    
  • Just print a YAML (or JSON) file to the terminal to look at it. By default, dyff will use a neat output schema which includes different colors and indent helper lines to improve readability. The colors are roughly based on the default Atom schema and work best on dark terminal backgrounds. The neat output is disabled if the output of dyff is redirected into a pipe, or you can disable it explicitly using the --plain flag.

    dyff yaml somefile.yml
    
  • Convert a YAML file to JSON and vice versa:

    dyff json https://raw.githubusercontent.com/cloudfoundry/cf-deployment/v1.19.0/cf-deployment.yml
    

    The dyff sub-command (yaml, or json) defines the output format, the tool automatically detects the input format itself.

    dyff yaml https://raw.githubusercontent.com/homeport/dyff/develop/assets/bosh-yaml/manifest.json
    
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].