Skip to content

Devioxic/Music-Sorter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🎵 Music Organizer Tool

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.

Features

  • Automatic Organization: Sorts music files into Artist/Album/Song folder 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

Installation

Prerequisites

  • Python 3.9+
  • git

Clone the repository

git clone <repository-url>
cd "Music Sorter"

Create a virtual environment

python -m venv venv

Activate virtual environment

Linux/MacOS:

source venv/bin/activate

Windows:

venv\Scripts\activate

Install dependencies

pip install mutagen rich questionary

Usage

Basic Usage

  1. Run the script:

    python main.py
  2. Follow the interactive prompts:

    • Select source music directory
    • Select destination directory
    • Choose copy (safe) or move mode

Directory Structure

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/
    └── ...

Examples

Basic Organization

# 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.m4a

License

This project is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE v3.0. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

About

A simply tool to organize your music based on metadata

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages