$npx skillfedfor your agent

unidiff

Unified diff parsing/metadata extraction library.

Worth itPyPI Python ModulesReleased Jul 202642.8M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — unidiff-1.0.0-py3-none-any.whl
v1.0.0 · released 2026-07-25 · Python >=3.9

Yes. Unidiff is stable (Production/Stable status), actively maintained, has no dependencies, and solves a clear problem—parsing unified diffs into queryable objects. Use it whenever you need to programmatically analyze patch files or diffs beyond simple text parsing.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.9 or later.
  • Low friction: pure Python wheel with no runtime dependencies.
  • Actively maintained with a recent release 20 days ago and steady commit activity.

License · maintenance · safety

MIT (permissive) — MIT license is permissive; you can use this library freely in open-source and commercial projects with minimal restrictions.

last release 2026-07-25 (20 days) · last repo commit 2026-08-07 · 286 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 42,832,452 downloads/mo, #652 on PyPI

Verify before relying

pip install unidiff

from unidiff import PatchSet
patch = PatchSet.from_filename('file.diff', encoding='utf-8')
for patched_file in patch:
    print(patched_file.path, patched_file.added, patched_file.removed)
Same gist for agents: .md · .json

What it is and what it does

Unidiff is a Python library that parses unified diff format (the standard output of git diff, patch files, and similar tools) into structured objects you can query and manipulate. It reads diff data from files, strings, or file-like objects and exposes a tree of PatchSet → PatchedFile → Hunk → Line objects, each with metadata like line numbers, change type (added/removed/context), file modes, and symlink status.

You can inspect statistics (how many lines were added or removed per file), detect binary changes, extract individual hunks or lines, and reconstruct the original diff from modified objects. It also ships as a command-line tool that summarizes diff statistics. The library requires Python 3.9 or later and has no external dependencies, making it straightforward to integrate into build tools, code review systems, or any workflow that needs to analyze patches programmatically.

Use it for

  • Parse git diffs or patch files in CI/CD pipelines to extract file change statistics and validate patch content.
  • Build code review tools that need to inspect individual hunks and lines to flag specific changes.
  • Analyze patch metadata (file modes, symlinks, binary status) in version control or deployment workflows.
  • Extract and filter specific changes from large diffs for reporting or automated testing.
  • Reconstruct or modify unified diffs by manipulating the object tree and regenerating the diff output.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

Unidiff is stable (Production/Stable status), actively maintained, has no dependencies, and solves a clear problem—parsing unified diffs into queryable objects. Use it whenever you need to programmatically analyze patch files or diffs beyond simple text parsing.

Install

unidiff on PyPI

Before you install

Low friction: pure Python wheel with no runtime dependencies. Actively maintained with a recent release 20 days ago and steady commit activity.

Requires Python 3.9 or later.

License in practice

MIT license is permissive; you can use this library freely in open-source and commercial projects with minimal restrictions.

Quickstart

pip install unidiff

from unidiff import PatchSet
patch = PatchSet.from_filename('file.diff', encoding='utf-8')
for patched_file in patch:
    print(patched_file.path, patched_file.added, patched_file.removed)

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.9
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 20 days since the last release
Last repo commit
First released
Downloads42,832,452 / month, #652 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Evidence: unidiff-1.0.0-py3-none-any.whl

Tags

Capabilities
parse unified diffdiff parsing librarypatch file parsergit diff parsingextract diff metadataunified diff formatdiff analysis tool
Topics
diff-parsingversion-controlcli-tool
PyPI keywords
unifieddiffparsemetadata

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “diff parsing library”

  • unidiffParses unified diff format data into structured Python objects,…
  • unidiff2Parses unified diff format into structured Python objects…
  • whatthepatchParses and applies patch files in multiple diff formats (unified,…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also unidiff2 · moreorless · patch · types-unidiff · whatthepatch · patch-ng · diff-match-patch · diff-parser · icdiff · datadiff