Skip to content

Little python library to help with tagging music files.

License

Notifications You must be signed in to change notification settings

colgiati/music-tagger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

music-tagger

Little python library to help with tagging music files. Recursively tags files in a given folder. Currently only works with .mp3 and .flac files. Uses mutagen to handle the tagging.

Setup

Tool is being developed using python 3.11. It might work with lower versions, but has not been tested with anything else.

Usage

The following changes are to be made in the main.py file. A basic configuration is given by default.


Set the path of the root folder containing the music files you want to be tagged.

path = 'C:/user/music'

Set the taggers you would like to use.

taggers = [
    BPMTagger(),
    LyricsTagger(
        sources=[LrcLib(), Spotify()]
    )
]

The taggers are applied to each song separately in the given order.


Build the Tagger. Set log=True if you would like the current directory to be printed.

if __name__ == '__main__':
    tagger = Tagger(path=path, taggers=taggers, log=True)
    tagger.run()

You can now run the program by running main.py.

py main.py

Taggers

More taggers exist in my private repository for this project. They will be published later on, once I add .mp3 support (currently they only work with .flac files).

LyricsTagger

Embeds synchronised lyrics into music files. Different sources for lyrics can be used with this tagger. Currently, there are two sources: LrcLib and Spotify. You can choose which sources you would like to use, by passing them to the LyricsTagger:

lyrics_tagger = LyricsTagger(
    sources=[LrcLib(), Spotify()]
)

Or if you only want to use one specific source:

lyrics_tagger = LyricsTagger(
    sources=[LrcLib()]
)

The sources are searched in the given order. If no lyrics are found in the first source, the next source is searched.

BPMTagger

Uses librosa (which uses ML) to estimate the BPM of a song. Adds the BPM as a tag.

This tagger takes no arguments, so just call the constructor:

bpm_tagger = BPMTagger()

and addd the tagger to the taggers list.

About

Little python library to help with tagging music files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages