Organizes the files in your Downloads folder based on their file extensions. The module moves files into predefined folders according to a configuration file, making it easier to find and manage your downloaded files.
Project description
DownloadSorter
DownloadSorter is a Python module that organizes the files in your Downloads folder based on their file extensions. The module moves files into predefined folders according to a configuration file, making it easier to find and manage your downloaded files.
Features
- Organizes files directly in the Downloads folder (non-recursive)
- Customizable folder organization using a JSON configuration file
- Automatically appends Unix timestamps to filenames to avoid conflicts
- Cross-platform compatibility
Getting Started
Prerequisites
- Python 3.x
- JSON configuration file (default:
sort.json
)
Installation
- Clone the repository or download the
sort_downloads.py
file. - Create a JSON configuration file, if not using the provided
sort.json
.
Configuration
The sort.json
file defines the folder organization for different file extensions. The structure of the JSON file is as follows:
{
"DestinationFolder1": ["ext1", "ext2"],
"DestinationFolder2": ["ext3", "ext4"]
}
For example, to organize music into the "Music" folder and image files into the "Pictures" folder, the sort.json
file should look like this:
{
"Music": [
".mp3",
".wma",
".ogg",
".wav"
],
"Pictures": [
".jpg",
".jpeg",
".png",
".gif",
".webm",
".bmp"
]
}
Usage
To use the DownloadSorter, simply run the sort_downloads.py
script:
python sort_downloads.py
By default, the script will organize files in the ~/Downloads
directory if you're using Windows, or ~/downloads
for non-Windows users. You can modify the downloads_path
variable in the script to point to a different directory if needed, or pass the directory path as a command line argument when running sort_downloads.py
.
Customization
If you want to customize DownloadSorter, you can modify the sort_downloads.py
script:
- Change the
config_file
parameter in theDownloadSorter
constructor to use a different JSON configuration file. - Update the
downloads_path
variable in the__main__
block to use a different directory for sorting files, or pass the directory path as a command line argument when runningsort_downloads.py
.
Contributing
Contributions are welcome! If you have any ideas, feature requests, or bug reports, feel free to submit an issue or create a pull request.
License
This project is licensed under the MIT License. See the LICENSE
file for details.
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
File details
Details for the file download_sorter-0.1.1.tar.gz
.
File metadata
- Download URL: download_sorter-0.1.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ce5fdf61ca38b238cca87fb476832263ea23cae98802af46a843c403f7da68c |
|
MD5 | 70b66021b89bae1ba2532e262e2c8af2 |
|
BLAKE2b-256 | 1a7e9fa351813c6a19df12c2eeb4783a038a2ed73c177964885a8de4790e94b9 |
File details
Details for the file download_sorter-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: download_sorter-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d198d8328e9fc0724b48446343aabbbba06f871302d96aae9b659d73d549f9a2 |
|
MD5 | 1c59ff890a75ea8085ef25e0584211b2 |
|
BLAKE2b-256 | e171fb576a9c7b14f7e5ecd4a152f6b69f37944efef02d3899a348fa7b4b3f1b |