Skip to content

Vaishnavi10706/File-System-Snapshot-Difference

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

42 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Python Streamlit License

πŸ“ File System Snapshot Difference

A Python-based developer tool that captures snapshots of a folder and compares them to detect added, modified, and removed files. The project includes a Streamlit web UI for easy interaction and a Folder Statistics feature that instantly previews folder details before creating snapshots. This project was developed as part of an On-the-Job Training (OJT) program to understand file system behavior, hashing, and UI integration using Streamlit.


πŸš€ Features

1. File Snapshot Generation

  • Captures a complete snapshot of a selected folder
  • Stores file metadata (file path + MD5 hash) in a JSON file
  • Helps track file-level changes across snapshot versions

2. Snapshot Comparison (Diff Tool)

Compares Snapshot A and Snapshot B to detect:

  • 🟒 Added Files – Present in Snapshot B but not in Snapshot A
  • 🟑 Modified Files – File content changed (detected via MD5 hash)
  • πŸ”΄ Removed Files – Present in Snapshot A but missing in Snapshot B

3. Folder Statistics (Automatic Preview)

As soon as the user enters a folder name in the Streamlit UI, the app automatically displays:

  • πŸ“„ Total Files
  • πŸ“ Total Folders
  • πŸ•’ Last Modified Time

This instant preview helps users understand the folder structure before taking a snapshot.

4. Streamlit Web UI

A clean and simple browser-based interface that allows users to:

  • Enter a folder name β†’ Automatically view folder statistics
  • Enter a snapshot name β†’ Generate a snapshot
  • Select two snapshots β†’ Compare and view differences
  • Clearly view added, modified, and removed files

5. Snapshot History Table

  • Displays all snapshots in a structured table

  • Columns include:

    • Snapshot Name
    • Date & Time
    • Number of files in the folder
    • Confirmation checkbox (safe delete)
    • Delete button

This feature helps users easily track which snapshots exist, when they were created, and safely delete them.


πŸ“Έ Screenshots

Folder Statistics & Snapshot Creation

Folder Statistics UI

Snapshot Comparison Output

Snapshot Diff Output

πŸ—‚οΈ Project Structure

FILE-SYSTEM-SNAPSHOT-DIFFERENCE/
β”‚
β”œβ”€β”€ folder/                 # Sample folder for testing
β”‚
β”œβ”€β”€ snapshots/              # Auto-generated snapshot JSON files
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ __pycache__/        # Cache files
β”‚   β”œβ”€β”€ diff.py             # Snapshot comparison logic
β”‚   β”œβ”€β”€ file_compare.py     # Line-by-line file comparison
β”‚   β”œβ”€β”€ main.py             # Streamlit backend logic
β”‚   └── snapshot.py         # Snapshot generation logic
β”‚
β”œβ”€β”€ app.py                  # Streamlit UI entry point
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
└── requirements.txt

πŸ› οΈ Tech Stack

  • Python 3
  • Streamlit
  • JSON
  • Hashlib (MD5)
  • OS Module

▢️ How to Run the Project

1. Install Dependencies

pip install -r requirements.txt

2. Run the Streamlit App

streamlit run app.py

🧭 How to Use the Streamlit UI

Step 1: View Folder Statistics (Automatic)

  • Enter the folder name in the input field

  • Press Enter

  • The app automatically displays:

    • Total Files
    • Total Folders
    • Last Modified Time

Step 2: Take a Snapshot

  • Enter a snapshot name
  • Click Take Snapshot
  • A new snapshot JSON file is created inside the snapshots/ folder

Step 3: Compare Snapshots

  • Enter Snapshot A name

  • Enter Snapshot B name

  • Click Compare Snapshots

  • The UI displays:

    • Added files
    • Modified files
    • Removed files

πŸ“Œ Example Output

Folder Statistics

  • Total Files: 1
  • Total Folders: 0
  • Last Modified: 2025-12-02 11:27:33

Snapshot Diff

Added Files

  • test2.txt

Modified Files

  • README.md
  • text1.txt

Removed Files

  • test3.txt

🎯 Purpose of the Project

This OJT project is designed to help learners understand:

  • How file systems store and update data
  • How hashing helps detect content changes
  • How to build real-world developer tools
  • How to integrate backend logic with a Streamlit web UI
  • How to compute folder statistics and metadata
  • How to design clean, professional, and scalable project architecture

🌱 Future Improvements (Optional)

  • Snapshot versioning and tagging
  • Export diff results as reports
  • UI filters and search
  • Support for large directories and ignore rules

⭐ If you found this project useful, consider starring the repository!

About

A Python-based developer tool to capture and compare folder snapshots using MD5 hashing, built with an interactive Streamlit web UI. Shows folder stats, history, and file-level changes (added/modified/removed) between snapshots.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages