A Python-based music library organizer that automatically sorts your music files into a clean directory structure based on metadata tags. It also handles LRC (lyrics) files.
- Automatic Organization: Sorts music files into
Artist/Album/Songfolder structure - Smart Artist Handling:
- Prefers album artist over track artist for consistent albums
- Removes featured artists (ft., feat., featuring) to avoid duplicate folders
- Takes only the first artist from multi-artist tracks
- LRC File Support: Automatically finds and moves/copies matching lyrics files
- Safe Mode: Option to copy files instead of moving them (non-destructive)
- Progress Tracking: Rich progress bars with time remaining estimates
- Filename Sanitization: Cleans filenames of illegal characters
- Multiple Audio Formats: Supports MP3, FLAC, WAV, OGG, M4A
- Python 3.9+
- git
git clone <repository-url>
cd "Music Sorter"python -m venv venvLinux/MacOS:
source venv/bin/activateWindows:
venv\Scripts\activatepip install mutagen rich questionary-
Run the script:
python main.py
-
Follow the interactive prompts:
- Select source music directory
- Select destination directory
- Choose copy (safe) or move mode
The tool organizes music into this structure:
Destination/
├── Artist Name/
│ ├── Album Name/
│ │ ├── Track 01.mp3
│ │ ├── Track 01.lrc
│ │ ├── Track 02.flac
│ │ └── Track 02.lrc
│ └── Another Album/
│ └── ...
└── Another Artist/
└── ...
# Source: /home/user/Downloads/Music
# Destination: /home/user/Music
# Mode: Copy (safe)
# Before:
Downloads/Music/
├── song1.mp3
├── song1.lrc
├── album-track.flac
└── random_song.m4a
# After:
Music/
├── Artist A/
│ └── Album X/
│ ├── Song 1.mp3
│ └── Song 1.lrc
└── Artist B/
└── Album Y/
└── Random Song.m4aThis project is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE v3.0. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.