Automatic file structuring and sorting script
Developed an autonomous Python script for automating routine tasks related to cleaning and structuring disk space. The utility organizes target directories (e.g., "Downloads" or work folders") independently, saving user time. Implemented functionalities and architectural solutions:
1) Intelligent sorting: the script scans the specified folder, identifies file types by their extensions, and automatically distributes them into corresponding categories (Documents, Images, Videos, Archives, Scripts, etc.) based on a flexible mapping dictionary.
2) Automatic structure creation: if the required folder for a category does not exist, the script dynamically creates it using the system library os.
3) Data stability and security: the code accounts for converting extensions to lowercase (.lower()) and implements mandatory object checks (os.path.isfile), preventing accidental movement of directories. The script is protected from crashes if the target path is missing.
4) Optimization for Linux/Ubuntu: the utility uses user path expansions (os.path.expanduser), operates instantly, and is ready for regular scheduled runs (cron).
Technology stack: Python 3.x, OS, Shutil (working with the file system and data streams), Linux.
1) Intelligent sorting: the script scans the specified folder, identifies file types by their extensions, and automatically distributes them into corresponding categories (Documents, Images, Videos, Archives, Scripts, etc.) based on a flexible mapping dictionary.
2) Automatic structure creation: if the required folder for a category does not exist, the script dynamically creates it using the system library os.
3) Data stability and security: the code accounts for converting extensions to lowercase (.lower()) and implements mandatory object checks (os.path.isfile), preventing accidental movement of directories. The script is protected from crashes if the target path is missing.
4) Optimization for Linux/Ubuntu: the utility uses user path expansions (os.path.expanduser), operates instantly, and is ready for regular scheduled runs (cron).
Technology stack: Python 3.x, OS, Shutil (working with the file system and data streams), Linux.