Here is the second part of the project "Sorter"
In this homework assignment, we will turn the folder cleanup script into a Python package and a command-line script that can be invoked anywhere in the system using the command clean-folder.
Many people have a folder on their desktop named something like "Sort". Typically, this folder remains unsorted indefinitely.I wrote a script that will sort this folder
This program can sort such extension
- Images ('JPEG', 'PNG', 'JPG', 'SVG')
- Video files ('AVI', 'MP4', 'MOV', 'MKV')
- Documents ('DOC', 'DOCX', 'TXT', 'PDF', 'XLSX', 'PPTX')
- Music ('MP3', 'OGG', 'WAV', 'AMR')
- Archives ('ZIP', 'GZ', 'TAR')
- Unknown extensions
The output of the script includes:
- A list of files in each category (music, video, photos, etc.)
- A list of all recognized script extensions found in the target folder.
- A list of all extensions that are unknown to the script.
The package is installed in the system using the command pip install -e . (or python setup.py install, requiring administrator privileges).
After installation, the package clean_folder becomes available in the system.
Once the package is installed, the script can be called from anywhere in the system using the command clean-folder.
The command-line script handles command-line arguments in the same way as the Python script.