pytags — set and remove tags on media files from filename and options
pytags [OPTIONS] file [file...]
pytags is a simple, general-purpose tool for setting and removing media file tags. With no options, pytags prints a tag summary for all files specified on the command line. Options can be used to set and remove tags on files.
Using --format, it is easy to change or create tags on
by parsing metadata from filenames according to an arbitrary format
string. This makes it simple to tag files that are consistently
named.
Additionally, tags can be manipulated directly with the
--add, --set, and
--remove options. These options are processed in order,
so options specified later on the command-line may cause values set by
earlier options to be overwritten. These options must appear after the
--format, if it is used.
--add=EXPRAppend a tag value all files according to EXPR. EXPR should be an expression like “artist=Foo”. May be specified multiple times to add multiple values.
--format=FORMAT
Tag files with metadata extrapolated from filenames using format
string FORMAT; see the section called “Format Strings”. This
option must be specified before --add,
--set, or --remove.
--set=EXPR
Set a single tag on all files according to EXPR. EXPR should be an
expression like “artist=Foo”. May be specified multiple times to set
multiple tags. --set cannot be used to specify
multiple values for a single tag. To do that, use
--remove followed by multiple --add
options.
--remove=TAGRemove tags named TAG. May be specified more than once to remove multiple tags.
-h, --helpShow summary of options and exit.
-v, --versionShow version of program and exit.
The format string expected by --format is the same as
that for pytagsfs. See the pytagsfs
manual page for more information.
Remove the genre tag from all .ogg files in the current directory.
$ pytags --remove genre *.ogg
Set the artist and album tag on all .mp3 files, and remove the genre tag.
$ pytags --set artist=Foo --set album=Bar --remove genre *.mp3
Tag all of the .flac files in the current directory. All such files are assumed to be in the format "tracknum artist - trackname [album].flac".
$ pytags --format '%n %a - %t [%l].flac' *.flac