Tired of messy folders? Let’s organize them in one command.
What
A Python tool that organizes files into folders (Documents, Images, etc.) and can rename .txt files using AI via the Google Gemini 1.5 Flash API for smart, content-based names.
Why
Downloads and desktop folders get cluttered fast. This script keeps everything sorted, readable, and meaningful— no more hunting for random file(7).txt.
How
-
Scan: Detects files and classifies them by type.
-
Move: Places each file in the right folder.
-
Rename (optional): Sends .txt content to Gemini for a suggested title.
-
Summary: Prints a clean report of actions taken.
Install
git clone <repo_url> cd <repo_directory> pip install google
Python 3.6+ required.
Run
Organize any folder:
python main.py --path "C:\Users\YourName\Downloads"
If --path is omitted, the script uses the current directory.
When prompted:
Enter 'yes' to use AI to rename files, or 'no' to skip:
Provide a Google Gemini API key to enable AI renaming.
Project Layout
file-organizer/ ├─ main.py # Entry point └─ organizer/ ├─ scanner.py # Scans & categorizes ├─ mover.py # Moves files ├─ renamer.py # AI renaming logic └─ display.py # Summary output
Example
Before:
Downloads/ ├─ image1.jpg ├─ document1.txt ├─ video.mov
After:
Downloads/ ├─ Images/image1.jpg ├─ Documents/SuggestedTitleFromAI.txt ├─ Videos/video.mov
License
MIT – free to use and modify.