Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

File System Analyzer & Scanner

A lightweight Python Command Line Interface (CLI) application that recursively scans directories or local drives (e.g., C:\) to categorize and report file distribution statistics based on extension types.

Features

  • 📁 Recursive drive and directory scanning using Python's os.walk

  • 🏷️ Automatic file categorization (Images, Documents, Videos, Audio, Archives, Code, Others)

  • 🔍 File extension classification matching over 30+ popular file extensions

  • 🙈 Automatic exclusion of hidden system files (files starting with .)

  • 📊 Comprehensive console output summarizing category counts and total file counts

  • ⚡ Memory-efficient execution suitable for large disk volumes

Technologies Used

  • Python 3

  • os (Standard Library)

  • Git & GitHub

Project Structure

File-System-Analyzer/
│
├── analyzer.py (or main.py)
├── README.md
├── .gitignore
└── venv/

Note: venv/ should not be uploaded to GitHub.

How It Works

The script follows a systematic process to scan and analyze your storage system:

  1. The user launches the application and specifies a target path or drive directory (defaults to C:\).

  2. The script checks for path existence using os.path.exists().

  3. The scanner walks recursively through the file system using os.walk().

  4. Hidden files (starting with .) and extensionless files are filtered out.

  5. Extracted file extensions are normalized to lowercase using os.path.splitext().

  6. Extensions are mapped against predefined category dictionaries (Images, Documents, Videos, Audio, Archives, Code).

  7. Files not matching known categories are grouped into an Others bucket.

  8. Aggregated file totals and category counts are formatted and displayed in the terminal.

File Categories Supported

The script scans and organizes files across these categories:

  • Images: .jpg, .jpeg, .png, .gif, .bmp, .svg, .webp

  • Documents: .pdf, .docx, .doc, .txt, .xlsx, .pptx, .csv

  • Videos: .mp4, .mkv, .avi, .mov, .flv, .wmv

  • Audio: .mp3, .wav, .aac, .flac, .m4a

  • Archives: .zip, .rar, .7z, .tar, .gz

  • Code: .py, .html, .css, .js, .json, .java, .cpp

  • Others: Any extension not explicitly defined in the above categories

Security & Git Configuration

The .gitignore file should contain:

venv/
__pycache__/
*.pyc
.DS_Store

Installation

1. Clone the Repository

git clone https://github.com/ayasreebiswas-cmd/File-System-Analyzer.git

2. Open the Project

cd File-System-Analyzer

3. Create a Virtual Environment (Optional)

On Windows:

python -m venv venv

4. Activate the Virtual Environment

On Windows:

venv\Scripts\activate

On macOS/Linux:

source venv/bin/activate

Running the Application

Ensure Python is installed, then execute the script from your terminal:

python analyzer.py

Example Console Output

Scanning drive (C:\)... This may take a few minutes.

--- File Summary ---
Images      : 1420
Documents   : 850
Videos      : 64
Audio       : 310
Archives    : 45
Code        : 612
Others      : 230
--------------------
Total files found: 3531

GitHub Workflow

After making changes to the project:

git status
git add .
git commit -m "Update project"
git push

Future Improvements

Possible future improvements include:

  • Interactive command line arguments (e.g., passing custom scan paths via argparse)
  • File size calculation (e.g., total MB/GB consumed per category)
  • Exporting scan reports to CSV, JSON, or HTML formats
  • Multi-threading support to accelerate scanning across large SSDs and HDDs
  • Duplicate file detection based on file hashing (MD5/SHA256)

Author

Ayasree Biswas

License

This project is intended for educational and project-development purposes.

About

A fast, recursive Python script that scans local drives, filters out hidden system files, and categorizes files by extension into detailed summary reports.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages