This Python script organizes your music files into folders based on their metadata tags (artist and album). It scans a specified directory for MP3 files and moves them into appropriate folders.
- Reads ID3 metadata from MP3 files to determine artist and album.
- Sanitizes filenames to avoid issues with special characters.
- Creates artist and album folders if they don't already exist.
- Moves files to their respective artist/album folders.
- Python 3.x
mutagenlibrary
-
Make sure you have Python 3 installed on your system.
-
Install the
mutagenlibrary using pip:pip install mutagen
- Save the script to a file, for example,
organize_music.py. - Modify the
folder_pathvariable to point to the directory containing your MP3 files. - Run the script:
- Ensure you have the necessary permissions to read and write files in the target directory.
- Backup your music files before running the script, as it moves files to new locations.
Feel free to fork this repository and submit pull requests. Your contributions are welcome!
This project is licensed under the MIT License.