ZEFHANAA GitHub avatar

autosort-file-organizer

ZEFHANAA

AutoSort is a Python CLI tool that automatically organizes messy folders into categorized directories by file extensions with dry-run and undo support.

Stars

6

7-day growth

No data

Forks

0

Open issues

0

License

MIT

Last updated

2026-07-28

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It offers zero external dependencies, a safe dry-run preview mode, and a full undo feature that makes file organization reversible and risk-free.

Who it is for

  • Users with cluttered Downloads or Desktop folders
  • Python developers seeking a customizable file sorting utility
  • System administrators automating file management tasks

Use cases

  • Organize a Downloads folder into subfolders like Images, Documents, Archives
  • Preview file moves before applying changes using --dry-run
  • Revert an accidental organization with a single --undo command

Strengths

  • Built entirely with Python standard library, no extra installs required
  • Configurable via config.py to add custom categories and ignore rules
  • Conflict resolution renames duplicates instead of overwriting
  • Dry-run and undo features provide safety and reversibility

Considerations

  • CLI only, no graphical interface
  • No built-in scheduling or real-time monitoring
  • Requires Python 3.8+ to run

README quick start

📂 AutoSort — Smart File Organizer Script

AutoSort is an open-source Python automation tool designed to clean up messy folders (such as Downloads or Desktop) by automatically sorting files into categorized directories based on file extensions.

It includes Dry-Run Preview Mode (to simulate moves safely) and Session Undo Support (to revert any organization with a single command).


✨ Features

  • 📁 Smart File Categorization: Automatically groups files into Images, Documents, Spreadsheets, Presentations, Videos, Audio, Archives, Programs, and Code_and_Data.
  • Dry-Run Preview (--dry-run): Preview where files will be moved before making any actual file system changes.
  • Full Undo Support (--undo): Easily revert the previous organization session and restore files to their exact original locations.
  • 🛡️ Conflict Resolution: Safely renames duplicate filenames instead of overwriting existing files.
  • ⚙️ Configurable Rules (config.py): Customize file categories, extensions, and ignore rules effortlessly.
  • 🚀 Zero External Dependencies: Built entirely using Python's standard library (os, shutil, argparse, pathlib, json).

🛠️ Usage & Commands

1. Organize Current Folder

python organizer.py

2. Organize a Specific Folder (e.g. Downloads)

python organizer.py C:\Users\YourUsername\Downloads

3. Dry-Run Preview Mode (Simulate without moving)

python organizer.py C:\Users\YourUsername\Downloads --dry-run

4. Undo Last Organization Session

python organizer.py --undo

📂 Project Structure

autosort/
├── organizer.py      # Core CLI logic and file movement engine
├── config.py         # Category rules, extension mappings, and ignore lists
├── README.md         # Documentation
└── .gitignore        # Git ignore config

⚙️ Customization (config.py)

You can edit config.py to add custom file categories or extensions:

FILE_CATEGORIES = {
    "Design_Files": [".psd", ".ai", ".fig", ".xd"],
    "Ebooks": [".pdf", ".epub", ".mobi"]
}

📄 License

Distributed under the MIT License. See LICENSE for details.

Built with ❤️ by @ZEFHANAA

Related repositories

Similar projects matched by category, topics, and programming language.

lopopolo
Featured
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI & Machine LearningAI Agents
2,390
slvDev
Featured
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI & Machine LearningLarge Language Models
1,960
littledivy
Featured
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI & Machine Learning
1,482