No project description provided
Project description
Sortasaurus-Rex: File Classification Script
Overview
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.
Features
- Automatic File Classification: Automatically categorizes files based on their extensions.
- Multithreading: Utilizes
ThreadPoolExecutor
to classify files in parallel for faster processing. - Progress Bar: Uses
tqdm
to display a real-time progress bar during the classification process. - Robust Path Handling: Utilizes
pathlib
for handling file and directory paths. - Error Handling: Provides detailed error messages and handles common file operation errors like
FileNotFoundError
andPermissionError
.
Prerequisites
- Python 3.6 or higher
tqdm
library
You can install tqdm
using pip if it's not already installed:
pip install tqdm
Usage
-
Run the Script:
Execute the script from the command line:
python srex.py
-
Enter the Source Directory:
When prompted, enter the path to the directory you want to classify.
Please enter the source directory to be monitored:
-
Script Execution:
The script will classify the files into the following categories:
- Images:
jpeg
,jpg
,png
- PDFs:
pdf
- Datasets:
csv
,xlsx
,json
- Videos & ShortVids:
mp4
,gif
- Other: Files that do not match any of the above categories
Each category will have its own directory created within the source directory.
- Images:
-
Completion:
The script will display the progress and log messages indicating where each file has been moved or if there were any errors.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- tqdm for the progress bar implementation.
- Python community for various open-source contributions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sortasaurus_rex-0.3.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d48e555ec4f237d3383e31fd081163ad228d1fc6d7921c1da295a1d0388189c |
|
MD5 | 5a91fe848b5c2942652cbafa6f0ff2a6 |
|
BLAKE2b-256 | 790235f9342b7658aa8448483acfdaad69053ac25af2e95404a468f593bd4510 |