Skip to main content

diff-parser

diff-parser is a Python package for parsing and representing diff files.

Parse a git diff data or .diff file. Access a list of properties including filenames, filepath, source-hash, target-hash and more for every file changed.

Installation

You can install diff-parser using pip:

pip install diff-parser

Usage

To use diff-parser, simply import the required modules and classes:

from diff_parser import Diff

# Example usage:
diff = Diff("path/to/diff/file.diff")
for block in diff:
    print(block.new_filename) # main.py
    print(block.new_filepath) # /path/to/main.py
    print(block.old_filename) # main.py
    print(block.old_filepath) # /path/to/main.py
    print(block.source_hash)  # abcdef
    print(block.target_hash)  # uvwxyz
    print(block.type)         # modified
    print(block.content)      # None (to be implemented)

Contributing

Contributions are welcome! If you find any bugs or have suggestions for improvements, please open an issue on the GitHub repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for diff-parser 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for diff-parser 1.1
File Size Uploaded
diff_parser-1.1.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for diff-parser 1.1
File Interpreter ABI Platform
diff_parser-1.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.7 kB

Release files / diff_parser-1.1.tar.gz

Download URL diff_parser-1.1.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e7eed851078380319ba503d20cb8f382088e2f794b54c31ca79759b17bda2f40
BLAKE2b-256 checksum
How to use checksums
cd3e72fb3d2456b7749302f2adbbc1050a1f6bd1ab92504fe836d6509fe42528
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.4

Release files / diff_parser-1.1-py3-none-any.whl

Download URL diff_parser-1.1-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a915aa00bfaed4e31e1c03bfc33a26ecdc5a00800cdbdecdbb83967b5f102a2b
BLAKE2b-256 checksum
How to use checksums
a78b2b631b6a9652994db7562834b0c5ee991e11a059ff679f6a5935fc83dde3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

1.1 This release

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page