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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| diff_parser-1.1.tar.gz | 4.0 kB | Without provenance | Details for diff_parser-1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| diff_parser-1.1-py3-none-any.whl | Python 3 | none | any | Details for diff_parser-1.1-py3-none-any.whl |
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
|
Security for diff-parser 1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.