ydiff
View colored, incremental diff in a workspace or from stdin, in side-by-side or unified moded, and auto paged.
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 ydiffuv
uv add ydiffpoetry
poetry add ydiffInstalling 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
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
icdiffIcdiff displays file differences in a…
permissive · top 5,000 on PyPI
moreorlessGenerates unified diffs with correct handling…
permissive · top 5,000 on PyPI
autopageAutomatically pipes terminal output to a pager…
permissive · top 5,000 on PyPI
pytest-clarityA pytest plugin that displays colored,…
permissive · top 15,000 on PyPI
pytest-icdiffA pytest plugin that replaces default assertion…
permissive · top 5,000 on PyPI
yapfYAPF automatically reformats Python code to…
permissive · top 5,000 on PyPI
redlinesRedlines compares two strings or text documents…
permissive · top 15,000 on PyPI
datadiffGenerates human-readable diffs of Python data…
permissive · top 15,000 on PyPI
pastelPastel adds colored text output to terminal…
permissive · top 5,000 on PyPI
mypy_baselineA CLI tool that captures mypy type errors as a…
permissive · top 15,000 on PyPI