ZEFHANAA GitHub avatar

autosort-file-organizer

ZEFHANAA

AutoSort 是一个 Python 命令行工具,能根据文件扩展名自动将杂乱文件夹分类整理,并支持预览和撤销操作。

Stars

6

7 天增长

暂无数据

Fork 数

0

开放 Issue

0

开源协议

MIT

最近更新

2026-07-28

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

该工具零外部依赖,提供安全的预览模式和完整的撤销功能,让文件整理变得可逆且无风险。

适合谁使用

  • 桌面或下载文件夹混乱的用户
  • 需要可定制文件分类工具的 Python 开发者
  • 自动化文件管理任务的系统管理员

典型使用场景

  • 将下载文件夹整理为图片、文档、压缩包等子文件夹
  • 使用 --dry-run 预览移动结果而不实际更改
  • 通过 --undo 一键撤销上一次整理操作

项目优势

  • 完全基于 Python 标准库,无需额外安装
  • 通过 config.py 可自定义分类规则和忽略列表
  • 冲突时自动重命名而非覆盖文件
  • 预览和撤销功能确保安全可逆

使用前须知

  • 仅命令行,无图形界面
  • 无内置定时或实时监控功能
  • 需要 Python 3.8 或更高版本

README 快速开始

📂 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

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

lopopolo
精选
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 与机器学习AI 智能体
2,390
slvDev
精选
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 与机器学习大语言模型
1,960
littledivy
精选
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 与机器学习
1,482