Skip to main content

A simple CLI audio tagger

Project description

audiotag

Tests CodeQL PyPI

Audiotag is a command line audio tagger written in python3. It uses TagLib to write the metadata. It features a very simple to use interactive mode which lets you tag a single album as fast as possible.

Installation

You can install audiotag directly from PyPI.

pip install audiotag

If you are running Arch Linux you can install it from the AUR. The package is called audiotag.

Usage

Audiotags functionality is split into different subcommands.

usage: audiotag [-h] [-v] {clean,copy,interactive,print,rename,set} ...

positional arguments:
  {clean,copy,interactive,print,rename,set}
    clean               delete all tags except 'ENCODER'
    copy                copy the tags from files in one folder to those in another folder
    interactive         tag a single album interactively. Treats files in subdirectories as different discs.
    print               print all tags
    rename              rename files based on their tags
    set                 set or delete tags

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit

Print

The print subcommand prints all tags. Multiple values per tag will be printed as a list.

$ audiotag print *.flac
Filename: /path/to/files/1 - At Giza.flac
ALBUM: 'Conference of the Birds'
ARTIST: 'Om'
DATE: '2006'
DISCNUMBER: '1'
DISCTOTAL: '1'
ENCODER: 'Lavf58.12.100'
GENRE: 'Doom Metal'
TITLE: 'At Giza'
TRACKNUMBER: '1'
TRACKTOTAL: '2'

Filename: /path/to/files/2 - Flight of the Eagle.flac
ALBUM: 'Conference of the Birds'
ARTIST: 'Om'
DATE: '2006'
DISCNUMBER: '1'
DISCTOTAL: '1'
ENCODER: 'Lavf58.12.100'
GENRE: 'Doom Metal'
TITLE: 'Flight of the Eagle'
TRACKNUMBER: '2'
TRACKTOTAL: '2'

Interactive

The interactive subcommand interprets all given files as a single album and asks for all the necessary information. If the the files are in different directories, audiotag assumes that each directory is a disk of a multi-disc release. The TRACKTOTAL and DISCTOTAL tags are set automatically.

$ audiotag interactive *.flac
Artist: Om
Albumtitle: Conference of the Birds
Genre: Doom Metal
Year: 2006
1 - At Giza.flac
Title 1: At Giza
2 - Flight of the Eagle.flac
Title 2: Flight of the Eagle

Set

If you want to set the tags in a non-interactive way you can use the set command. You can choose from these options:

  • --artist="Example"
  • --title="Example"
  • --album="Example"
  • --date=2000
  • --genre="Example"
  • --tracknumber=1
  • --discnumber=2
  • --tracktotal=10
  • --disctotal=2

If you want to remove tags you can choose these options:

  • --noartist
  • --notitle
  • --noalbum
  • --nodate
  • --nogenre
  • --notracknumber
  • --nodiscnumber
  • --notracktotal
  • --nodisctotal

You can combine these options as you like. Here is an example:

$ audiotag set --artist=Om --album="Conference of the Birds" --nodiscnumber 01-at_giza.flac

Clean

The clean subcommand removes all tags from the given files. If you want to keep certain tags, you can specify them using the --keep parameter. If none are specified, audiotag defaults to keeping the ENCODER tag.

Rename

The rename subcommand lets you rename files based on the audio tags. You have to provide a pattern for renaming. The pattern may contain a combination of these placeholders:

  • {A}: Artist
  • {T}: Title
  • {L}: Album
  • {Y}: Date
  • {G}: Genre
  • {N}: Tracknumber
  • {D}: Discnumber
  • {NT}: Tracktotal
  • {DT}: Disctotal

If you don't specify a pattern, audiotag will use {N} - {T} if the Disctotal tag is set to 1 or {D}-{N} - {T} if the Disctotal tag is set to something else or missing. You do not have to add the extension to the pattern. Audiotag adds the extension to the output file name for you.

$ ls
01-at_giza.flac  02-flight_of_the_eagle.flac

$ audiotag rename *.flac

$ ls
'1 - At Giza.flac'  '2 - Flight of the Eagle.flac'

If the new filename already exists Audiotag will ask if you want to overwrite the existing file. This check can be disabled with the -f or --force option.

Copy

The copy subcommand copies the tags from all the files in the sourcefolder to corresponding files in the destination folder. The filenames are sorted alphabetically before they are matched. Note that the ENCODER tag ist not copied.

Dependencies

The following dependencies are needed to run audiotag:

  • pytaglib: Python wrapper for accessing TagLib

Optional dependencies are:

  • gnureadline: For better user input (Readline should already be installed on any Linux system)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

audiotag-0.5.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

audiotag-0.5.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file audiotag-0.5.0.tar.gz.

File metadata

  • Download URL: audiotag-0.5.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for audiotag-0.5.0.tar.gz
Algorithm Hash digest
SHA256 4e9539bbb3d553540f61fbb786ade0247d6ecab8b3fa46d35ac80863f40672d7
MD5 99346c48107a58f541a93d0a25696603
BLAKE2b-256 452d306848e62897db1aeaa7d14bac00478f1364e48c4410a6fc12ce5f3821ad

See more details on using hashes here.

File details

Details for the file audiotag-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: audiotag-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for audiotag-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e3dff06c1dcca5c3b5e286d8089c7b942ed1816d3e5a885aabbf8de45287b60
MD5 ff3f40a2483579410a176ae6e626adb7
BLAKE2b-256 237cb425886fa0c027b11e437c08142ed4d0f6aa2ad2cf940d7827297d53f6e4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page