Metadata-Version: 2.4
Name: file-diff-analyzer
Version: 0.1.0
Summary: Analyze function-level code differences between two versions of a file
Author-email: Abdul Rehman <arehman8125@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Abdul Rehman
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
        THE SOFTWARE.
        
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 🧩 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)



