Skip to content

CLI tool for tagging and editing tags & filenames in audio files (flac, mp3, etc)

License

Notifications You must be signed in to change notification settings

balinbob/pytaggr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pytaggr

  • Program:        pytaggr
  • Author:           Bob Allred
  • License:         GPLv3.0 or later
  • Dependency:  Mutagen
  • Language:      Python
A command-line tool for tagging and editing tags in audio formats which can also
tag from filenames/paths, and rename files from tags. It implements the Mutagen
pure-python library for working with audio metadata, which adheres to the principles
of standardized tagging. It can also write multiple values for a tag (such as genre, or artist).
Using globs (*.flac, ~/Music/Album/0?\ -\ *.mp3), batch editing of multiple files can
be done. PyTaggr is well-suited for editing tracks in the files of an album, set, etc.
Like many cli utilities, with a bit of practice it can become a powerful tool for working
with flac, apev2, ogg vorbis, & mp3 files, and other formats.

Usage: pytaggr [options] filenames

  • Options:
  • -h|--help
    • show this help text & exit
  • -t|--tag TAG=VALUE
    • set a tag, ie pytaggr -t artist='The Beatles' -t album='Rubber Soul' *.flac
  • -a|--add TAG=VALUE
    • set or add a value to a tag, without removing any existing values
  • -r|--remove TAG or TAG=VALUE
    • remove a tag or a value from a multi-valued tag
  • -p PATTERN|--pattern=PATTERN
    • substitution pattern from filepath/name, ie: pytaggr -p '%l/%n - %t.flac' *.flac
  • --fn2tag PATTERN
    • same as -p|--pattern
  • --tag2fn PATTERN
    • substitution pattern from existing tags, to rename files, ie: pytaggr '%n. %t' *.mp3
  • -j|--justify
    • zero-justify tracknumbers ie 01 rather than 1
  • --clear
    • clear all tags
  • -n|--noact
    • only show the changes that would be made
  • -c|--confirm
    • show changes and prompt for confirmation
  • -q|--quiet
    • resist printing on stdout
  • -m '/ -' | --map '/ -'
    • tricky one, used in conjunction with --tag2fn, convert any of one char to another char
    • (similar to the tr utility)
    • useful for weeding out non-filename-friendly chars
  • -i|--index
    • index-tag the files in the order they currently sort by filename
    • places an integer tag into the file, in case sort order gets botched
    • (such as accidentally removing leading tracknumbers from filenames)

Using no options (only a filename) prints all tags in the file

pytaggr id3help: for help with id3 tags

  • examples:

  • pytaggr -t artist="Jerry Garcia Band" --fn2tag '%n %t.flac' *.flac

    • tags all flac files with an artist, and gets the tracknumber & title from the filename
  • pytaggr --tag2fn '~/Music/%a/%l/%n - %t.mp3' 1*.mp3

    • renames all mp3 files which begin with '1' this way:
    • ~/Music/Artist Name/Album Title/Number - Title.mp3
    • (provided the files are properly tagged)

About

CLI tool for tagging and editing tags & filenames in audio files (flac, mp3, etc)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages