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 --pattern, 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 set and removed explicitly with the
--set and --remove options,
respectively.
--pattern=PATTERNTag files with metadata extrapolated from filenames using format string PATTERN; see the section called “Format Strings”.
--set=EXPRSet 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. Tags are set in order, so, if the same tag is set more than once, the last one sticks. Be sure to use appropriate shell quoting.
--remove=TAGRemove tags named TAG. May be specified more than once to indicate the removal of multiple tags.
-h, --helpShow summary of options and exit.
-v, --versionShow version of program and exit.
The format string expected by --pattern is similar to the
format string accepted by pytagsfs, except that a more
limited set of substition characters are allowed:
n track number |
a artist |
t track title |
l album title |
y year of release |
g genre |
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 --pattern '%n %a - %t [%l].flac' *.flac