This script classifies files in a specified directory into predefined categories based on their extensions. It uses multithreading to speed up the classification process and provides real-time progress updates using a progress bar. The script ensures that the source directory exists and is not empty before processing, and handles errors gracefully.
ThreadPoolExecutor for parallel processing.tqdm.pathlib for cross-platform compatibility.tqdm libraryYou can install tqdm using pip if it's not already installed:
pip install tqdm pip install sortasaurus-rexRun the Script:
Execute the script from the command line:
srexEnter the Source Directory:
When prompted, enter the path to the directory you want to classify.
Please enter the source directory to be monitored: /path/to/your/directory
You can leave the value empty for the current working directory
Script Execution:
Sortasaurus-Rex will process the files, displaying progress and creating the following category subdirectories:
jpeg, jpg, pngpdfcsv, xlsx, jsonmp4, gifEach category will have its own directory created within the source directory.
Completion:
The script will display the progress and log messages indicating where each file has been moved or if there were any errors.
Currently, Sortasaurus-Rex uses predefined categories. Future versions may include customizable category definitions.
This project is licensed under the MIT License - see the LICENSE file for details.
For issues, questions, or contributions, please open an issue on the GitHub repository.