Analyze function-level code differences between two versions of a file
Project description
🧩 File Diff Analyzer (FDA)
Analyze function-level and line-level differences between two source code versions — ideal for vulnerability tracking, patch comparison, and static analysis.
🪶 Highlights
- 🧠 Compare two files and extract unified diffs (line-level) using Python file diff analyzer.
- 🧩 Detect added, removed, or modified functions and save them to structured folders.
- 📁 Analyze entire directories recursively to find and compare matching files.
- 🪟 File writing uses Windows-safe sanitized names and creates directories automatically.
- 🧰 Zero external dependencies — Python Standard Library only.
⚙️ Requirements
- Python 3.8 or later
- Works on Windows, macOS, and Linux
- No external dependencies!
📦 Installation
pip install file_diff_analyzer
from file_diff_analyzer import FileChangeAnalyzer
Compare two files:
- analyzer = FileChangeAnalyzer(output_dir="my_analysis_output")
- result = analyzer.analyze_files(
- r"D:\Projects\old_version\main.c",
- r"D:\Projects\new_version\main.c"
- )
- print("Saved analysis to:", result)
Compare two directories:
- results = analyzer.analyze_directories(
- r"C:\Projects\version1",
- r"C:\Projects\version2"
- )
- print("Directory analysis complete. Output folder:", results)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file file_diff_analyzer-0.1.0.tar.gz.
File metadata
- Download URL: file_diff_analyzer-0.1.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cad4fb911dd6e3096e5e12873c6ee14e0582b33ddb80903b5574d5af00a52ea0
|
|
| MD5 |
17c9ec8ecc5b0597c30d2428f1fd9f04
|
|
| BLAKE2b-256 |
3fe75ef2ed4aa7d497cb6eec4920a0430f898f9d2165043646d903040cfe47c0
|
File details
Details for the file file_diff_analyzer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: file_diff_analyzer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d35255aa923cbcbcc9dfd294a0956ac6c579209cd9eac7f8951ac6e3f2ae8004
|
|
| MD5 |
4129a7b87dd60688bbadf5a652e9a0d0
|
|
| BLAKE2b-256 |
1e4722b6b4e963113d3f76acfe7e5aab7b031c00ea29d2074cb63fd3ef7273ee
|