Skip to content

neyzik232/File_organizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Organizer

A command-line utility that takes a messy folder and sorts everything inside it into clean, labeled categories — automatically.


Why I built this

I kept running into the same problem: a Downloads folder full of hundreds of random files with no structure. PDFs mixed with memes, ZIP archives sitting next to Python scripts. Searching for anything was a nightmare.

I wanted a tool I could actually use — not just mv commands buried in a shell script, but something with a proper menu, a preview mode so you don't accidentally move the wrong files, and duplicate handling so nothing gets silently overwritten.

This project was also a good excuse to work with pathlib and shutil properly instead of relying on os.path for everything.


What it does

  • Scans a folder (including subfolders) for all files
  • Sorts them into categories: Images, Documents, Code, Archives, Audio, Video, Other
  • Supports preview mode — see what would happen before anything moves
  • Supports move or copy mode
  • Optionally cleans up filenames (spaces → underscores)
  • Handles duplicates automatically (file.jpgfile_1.jpg)
  • Skips hidden and system files
  • Prints a summary when done

Project structure

file_organizer/
├── main.py         # Menu and user interaction
├── organizer.py    # Core scan + organize logic
├── categorizer.py  # File extension → category mapping
├── utils.py        # Path validation, renaming, duplicate handling
├── config.py       # Category definitions and settings
└── README.md

How to run it

Requirements: Python 3.10 or higher (uses pathlib and type hints)

  1. Clone or download the project folder
  2. Open a terminal inside the file_organizer/ directory
  3. Run:
python main.py
  1. Follow the menu:
    • Set your source folder (the messy one)
    • Set your destination folder (where Organized_Files/ will be created)
    • Run a preview first to see what will happen
    • Then organize

Output structure

Organized_Files/
├── Images/
├── Documents/
├── Code/
├── Archives/
├── Audio/
├── Video/
└── Other/

Technologies used

  • Python 3.10+
  • pathlib — modern path handling
  • shutil — file move and copy operations
  • re — filename cleanup
  • No external dependencies

Notes

  • The tool won't touch the original files in preview mode
  • If you use move mode, files are removed from the source after moving
  • Hidden files (dotfiles, __MACOSX, etc.) are automatically ignored
  • If a file with the same name already exists at the destination, it gets renamed with a counter suffix instead of being overwritten

Author

GitHub: https://github.com/neyzik232

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages