Skip to main content

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

Features

  • Intelligent File Classification: Automatically categorizes files into Images, PDFs, Datasets, Videos & ShortVids, and Other.
  • High-Performance: Utilizes multithreading via ThreadPoolExecutor for parallel processing.
  • Real-Time Progress: Displays a live progress bar using tqdm.
  • Robust File Handling: Uses pathlib for cross-platform compatibility.
  • Error Management: Gracefully handles and logs common file operation errors.
  • Comprehensive Logging: Records detailed process information and errors to both console and file.

Prerequisites

  • Python 3.6 or higher
  • tqdm library

You can install tqdm using pip if it's not already installed:

pip install tqdm

Installation

  1. Ensure you have Python 3.6 or higher installed.
  2. Install Sortasaurus-Rex using pip:
   pip install sortasaurus-rex

Usage

  1. Run the Script:

    Execute the script from the command line:

    srex
    
  2. Enter 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

  3. Script Execution:

    Sortasaurus-Rex will process the files, displaying progress and creating the following category subdirectories:

    • 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.

  4. Completion:

    The script will display the progress and log messages indicating where each file has been moved or if there were any errors.

Configuration

Currently, Sortasaurus-Rex uses predefined categories. Future versions may include customizable category definitions.

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.

Support

For issues, questions, or contributions, please open an issue on the GitHub repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sortasaurus_rex-0.4.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sortasaurus_rex-0.4.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file sortasaurus_rex-0.4.0.tar.gz.

File metadata

  • Download URL: sortasaurus_rex-0.4.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for sortasaurus_rex-0.4.0.tar.gz
Algorithm Hash digest
SHA256 6026bf1264e641f7b872cbc5d7499b889606f935c4536d69e1b0be546b3851b7
MD5 c0868c95fb9428002fa13c897b0e5fdc
BLAKE2b-256 c7d76113ab56347c85824e399be159eb8ba90da38dbb65ba418e2db8d1350631

See more details on using hashes here.

File details

Details for the file sortasaurus_rex-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sortasaurus_rex-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d3ffa075806eef187e41c53d00c8e8fd4c2c916b919d12d314170b7b58a6b5e
MD5 ca436f7da577d9ac3970677db8093d3a
BLAKE2b-256 f01aa113f7182643c1a11bdba6bad6b1c96499dbd942a8d435c68db8afff86ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page