Home

Awesome

https://github.com/tdeerenberg/Musort/assets/113618658/38ce8dc2-7a5f-4edd-9d56-11408d1d56dd

Musort

Musort: Effortlessly organize your music library with this Python3 program. Rename selected music/audio files in a folder using a customizable naming convention based on metadata (ID3) from the audio files. Ensure accurate metadata by using popular tools like MusicBrainz Picard, Beets, or EasyTAG before running Musort. Simplify your music organization and enhance file names for a more enjoyable library experience.

Features

Dependencies

Make sure to install these programs to be able to run Musort

The Python3 library TinyTag is also used, but is already included in this repository. Therefore, there is no need to install TinyTag for only this project.

Installation and Usage

Method 1: Run installation script (Unix/Linux based OS only)

The installation script will move the python program to ~/.local/bin. The installation directory can be changed in the install.sh script. Note: The installation directory should be added to $PATH

git clone https://github.com/tdeerenberg/Musort.git
cd Musort
chmod +x install.sh
./install.sh

After that, simply use the command musort to use the program.

<hr>

Method 2: Clone repo and run manually (All Operating Systems)

Clone the repository and run the Python program

git clone https://github.com/tdeerenberg/Musort.git
cd Musort
pip install requirements.txt

After that, run the program with python3 musort.py.

<hr>

Method 3: Docker installation

git clone https://github.com/tdeerenberg/Musort.git
cd Musort
docker build -t musort .

After the Docker installation/build is complete, Musort can be run with:

docker run --name musort --rm -v "[music_directory_host]:[music_directory_container]" -it musort [music_directory_container]

The music folder must be mounted to the Docker container, therefore the -v option must be used to mount the directory.

An example of running Musort in Docker, using /home/user/music as music folder:

docker run --name musort --rm -v '/home/user/music:/music' -it musort /music

Manual with options and arguments (musort --help)

USAGE:
musort [DIRECTORY] [OPTIONAL_PARAMETERS]
    USAGE EXAMPLES:
    musort ~/music
    musort /local/music -f disc.artist.title.album -r
    musort ~/my_music -s _ -r
    
OPTIONAL OPTIONS:
-h, --help           Show the help menu
-f, --format         set the naming convention (see 'NAMING CONVENTION:' below)
-s, --separator      Set the separator for the filename (ex. '-s .' -> 01.track.flac and '-s -' -> 01-track.mp3)
                     Default separator '_' will be used if none is given
-r, --recursive      Rename files in subdirectories as well
-v, --version        Prints the version number

NAMING CONVENTION:
FORMAT_OPTION.FORMAT_OPTION...      The amount of format options does not matter.
                                    It can be one, two, three, even all of them.
                                    (See FORMAT OPTIONS below for all options)                      
FORMAT OPTIONS:
album           album as string
albumartist     album artist as string
artist          artist name as string
audio_offset    number of bytes before audio data begins
bitdepth        bit depth for lossless audio
bitrate         bitrate in kBits/s
comment         file comment as string
composer        composer as string 
disc            disc number
disc_total      the total number of discs
duration        duration of the song in seconds
filesize        file size in bytes
genre           genre as string
samplerate      samples per second
title           title of the song
track           track number as string
track_total     total number of tracks as string
year            year or date as string

Possible features to add

Authors

License

GNU GPLv3 Permissions of this strong copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights.