--- id: diff-parser version: "1.1" license: MIT License Copyright (c) 2024 Shaik Abdus Samad Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) license_treatment: permissive maintenance: dormant --- # diff-parser — Parse git diff data or .diff file. Access a list of properties including filenames, filepath, source-hash, target-hash and more for every file changed. License: permissive · Maintenance: dormant · Downloads: 237.8K/mo ## What it is and what it does diff-parser is a lightweight Python library for reading and extracting structured information from diff files. It takes a path to a git diff or .diff file and parses it into blocks, each representing a changed file with accessible properties like old and new filenames, filepaths, source and target hashes, and change type. The package has no external runtime dependencies and supports Python 3.6 and later. It is intended for developers who need programmatic access to diff metadata—for example, in build tools, code review automation, or version control workflows. The project is dormant but stable; the last commit was 2024-12-30, and no security vulnerabilities have been reported. Use it for: - Extract metadata about changed files from git diff output in CI/CD pipelines for conditional build steps. - Analyze which files were modified in a commit to generate automated reports or trigger downstream tasks. - Parse .diff files from patch management or code review tools to identify affected modules or dependencies. - Build tooling that needs to programmatically inspect file changes without shelling out to git commands. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses git diff and .diff files to extract structured metadata about changed files, including filenames, filepaths, source and target hashes, and change type. Yes, if you need to parse diff files programmatically. The package is simple, dependency-free, and permissively licensed. However, maintenance is dormant—no updates since 2024-09-09—so evaluate whether the feature set meets your needs and whether you can maintain a fork if required. Verify that the available properties are sufficient for your use case. ## Install pip install diff-parser uv add diff-parser poetry add diff-parser ## Installing diff-parser Before you install: Low install friction with no runtime dependencies. Maintenance is dormant—last commit was 2024-12-30, but the repository remains active and the package has received no updates since its 2024-09-09 release. License in practice: MIT License permits unrestricted use, modification, and redistribution with minimal restrictions, making it suitable for both open-source and commercial projects. Quickstart: pip install diff-parser from diff_parser import Diff diff = Diff("path/to/diff/file.diff") for block in diff: print(block.new_filename) print(block.source_hash) print(block.target_hash) print(block.type) Requires Python 3.6 or later. Verify before relying: - Whether the package handles edge cases in diff format variations beyond git diff. - Performance characteristics when parsing large diff files or many files in sequence. - Current state of the 'content' field, which documentation notes is 'to be implemented'. ## Package facts - License: MIT License Copyright (c) 2024 Shaik Abdus Samad Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 237.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags parse diff files, git diff parser, extract diff metadata, diff file analysis, parse .diff format, git change extraction, diff file reader, diff-parsing, git-utilities, build-tools [View on SkillFed](https://skillfed.io/packages/diff-parser) · [View on PyPI](https://pypi.org/project/diff-parser/)