Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

File Organizer

Overview

The File Organizer is a simple application that helps users automatically sort and organize files within a selected directory based on predefined file type mappings. It provides a GUI for selecting the directory and categorizes files into subfolders based on their extensions.

Prerequisites

  • The application runs on Windows.
  • Python must be installed on your system.

Installation

  1. Download and save the script to your local system.
  2. Ensure you have Python installed (recommended version: 3.7 or later).

Configuration

The file type mappings must be defined in a JSON configuration file (file_mapping.json) Example configuration:

{
    "Images": [".jpg", ".png", ".gif"],
    "Documents": [".pdf", ".docx", ".txt"],
    "Videos": [".mp4", ".avi", ".mkv"]
}

Each key represents a folder name, and its associated list contains file extensions that should be moved into that folder.

Usage

  1. Run script python file_organizer.py
  2. A GUI window will prompt you to select a directory to organize.
  3. The application will scan the directory and move files into categorized folders based on the mappings in file_mapping.json.
  4. A log file (logs.log) will be maintained at %LOCALAPPDATA%/FileOrganizer for tracking file movements and errors.

Error Handling

  • If the configuration file is missing, a notification will be shown.
  • If the configuration file contains invalid JSON, an error message will be displayed.
  • If the selected directory does not exist, the user will be notified.

Logging

All actions and errors are logged in:

logs.log

Log messages include:

  • Information about moved files.
  • Warnings for missing configuration.
  • Errors for invalid directories.

Support

For any issues or enhancements, update the file_mapping.json file accordingly or check the logs for debugging information.

About

Simple Python script to sort and organize files into folders based on file type.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages