skillfed

ydiff

View colored, incremental diff in a workspace or from stdin, in side-by-side or unified moded, and auto paged.

ydiff v1.5 97.6K downloads/30d#13,138 on PyPI930
Permissive license BSD-3 Active released

What it is and what it does

Ydiff is a terminal-based diff viewer that renders diffs with color and formatting, supporting both side-by-side (similar to diff -y) and unified modes. It integrates with version control systems (Git, Mercurial, Perforce, Svn) to display workspace changes, commit logs, or arbitrary diffs piped from stdin. The tool auto-detects terminal width, wraps or truncates lines as configured, and pages output through less or another pager of your choice.

The package requires only Python built-in libraries and less, making it lightweight and portable. It supports customized color themes via INI configuration files and respects environment variables for default options. Ydiff is designed for developers who want a quick, colored alternative to standard diff output without installing heavy dependencies.

Use it for:

  • Review git diffs with color and side-by-side formatting before committing changes.
  • Examine commit history with inline changes using ydiff -l in a version-controlled workspace.
  • Pipe arbitrary diffs (from git show, svn diff, or patch files) into ydiff for colored viewing.
  • Compare two files or directories with unified or side-by-side output and custom text width.
  • Inspect GitHub pull request diffs by piping curl output directly to ydiff.
  • Redirect colored diff output to a patch file while preserving formatting.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Ydiff displays colored, incremental diffs in a terminal with side-by-side or unified formatting, auto-paging support, and no external dependencies beyond Python and less.

Yes. Ydiff is a lightweight, actively maintained tool with no external dependencies, permissive licensing, and a clear use case for developers who want colored, formatted diffs in the terminal. Install it if you regularly review diffs and prefer a simpler alternative to full-featured diff tools.

Install

ydiff on PyPI

pip

pip install ydiff

uv

uv add ydiff

poetry

poetry add ydiff

Installing ydiff

Before you install

Installation is straightforward with low friction—the package is a pure Python wheel with no runtime dependencies, only requiring Python >= 3.3 and less as a pager. The project is actively maintained with a recent release and 930 repository stars.

License in practice

Ydiff is licensed under BSD-3 (permissive), so you can use, modify, and distribute it freely in both open-source and commercial projects with minimal restrictions.

Quickstart

pip install ydiff

# View colored diff in a git workspace
cd your-project
ydiff

# Or pipe a diff directly
git diff | ydiff

Requires less as a pager (or another pager specified via -p flag); Python >= 3.3.

Verify before relying

  • Whether wide-character alignment issues in side-by-side mode affect common use cases or only edge cases.
  • Performance characteristics when viewing very large diffs or log histories.

Package facts

License BSD-3 (permissive)
Python support supports the current Python release (>=3.3)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 251 days since the last release
Last repo commit
First released
Downloads 97,643/month — #13,138 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: ydiff-1.5-py3-none-any.whl

Keywords: colored, incremental, side-by-side, diff

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: MacOS :: MacOS XOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Utilities

Tags

colored diff viewer terminalside-by-side diff displayincremental diff toolgit diff colorizerunified diff formatterterminal diff pagersyntax-highlighted diffs
diff-viewerterminal-uivcs-integration

More Utilities packages