Beets for Mere Mortals
A music collection slowly turns into a
junk drawer. Files named track01.mp3
sit next to files named by three
different ripping programs in three
different styles, the same album lives
in two folders, and one copy in five
has a typo in its tags — so your player
shows the same band as two different
artists. Beets is the librarian
for that drawer. It reads the tags
inside your music files — artist,
album, title, track number — keeps a
small database of them, and files the
music itself into a folder layout built
from those tags. Fix a tag once, in one
place, and the database and the file
agree from then on.
Beets has a second trick, and it is the famous one: autotagging. Point it at a folder of badly named files and it consults MusicBrainz, the open music encyclopedia, comparing your files' tags and track lengths against its records, and proposes the correct artist, album, titles and order — which it then writes into the tags and uses to file everything neatly. Used carefully it can rescue a library that was never tagged at all.
One privacy fact belongs up front, because the two halves of beets differ here. Everything beets does with your own tags — importing as-is, querying, fixing, filing — happens entirely on your machine. Autotagging is the exception: to match an album, beets sends that album's artist and title strings and its track lengths to MusicBrainz's servers. It never sends the audio. Chapter 7 shows exactly what a match looks like, and chapter 4 shows the as-is mode that sends nothing at all.
The lab that wrote this guide ran the
real thing: beets 2.14.1, installed
from PyPI into a Python virtual
environment on a small Linux machine.
Its library was a fixture collection
built for the purpose — short generated
tones and one stretch of silence,
tagged as albums by two invented
artists, The Lab Tones and Ada Volt &
The Resistors. Against it the lab
imported as-is, queried the library
four ways, read a file's tags back with
the info plugin, fixed a misspelled
album name at track level and at album
level, moved the files to match, and
discovered — by trying, three ways —
that beets keeps album records stubbornly
separate, before reuniting one properly.
It imported a byte-for-byte duplicate,
watched the duplicates plugin miss it
twice (once by MusicBrainz IDs it did
not have, once by a checksum that
beets' own embedded cover art had
changed), and caught it by tag keys.
It fetched cover art from a local
folder, embedded that art into FLAC
files, served the whole library as
JSON over a local web interface, and
found the one field — the multi-value
genres — that beet update reports
but, in this version, does not store.
For autotagging, the lab generated a two-minute tone, tagged it as a famous 1965 recording of exactly that length, and let beets match it against the real MusicBrainz. It matched, at 100.0% — which proves the metadata path works, and also proves its known weakness: beets matched the tags and the duration, never the sound, because beets does not listen. A wrong file with right-looking tags and the right length would have matched just as well. Chapter 7 tells that story in full and draws the lesson: autotagging is a powerful proposal engine, and you are the reviewer.
What the lab could not do, it did not
fake. Album-level autotagging of a
real, badly tagged album — the
five-candidate interactive session
most users meet — is taught from the
documentation, because the lab's
fixtures are invented music with no
MusicBrainz entry to match against.
The remote art sources (the Cover Art
Archive and friends) were not used;
only the local-folder source was run.
criteria.md keeps the full ledger.
What this guide covers
- What beets is — the mental model: tags in, a database and a tidy folder tree out, and the two kinds of import
- The moving parts — the config file, the SQLite library, the directory the files live in, the tag reader, MusicBrainz, and plugins
- Installing beets — the Python package, a virtual environment to keep it in, and the version check that proves it runs
- Your first import — a minimal config, importing a folder as-is, and reading the resulting tree
- Asking your library —
the query language, listings and
albums, custom output formats, and
what
infoandstatscan tell you - Fixing tags —
modifyfor tracks and for albums,moveto make the files follow, the album-record lesson, andupdate - Autotagging — how matching really works, the candidate session, quiet and timid modes, and the duplicate question every import asks
- Duplicates — the duplicates plugin, its three ways of deciding two tracks are the same, and deleting the spares safely
- Art and plugins — fetchart's sources (including the local folder), embedart, the web plugin's JSON interface, and how plugins are switched on
- Recipes — an import routine for new arrivals, a playlist from a query, a monthly duplicate sweep, and exporting a catalogue
- The neighbours — MusicBrainz Picard, the streaming servers, and the players: what each does that beets doesn't, and vice versa
- Limits — album records that will not merge, matching that never hears the music, classical music, and a database that is one file deep
- Troubleshooting — the prompt that waits forever, the album that split in two, the art that was not found, and the update that does not land
- Glossary — the terms, collected in one place
What it doesn't cover
Downloading music — beets organises files you already have, and says nothing about where they came from. Ripping CDs (other tools do the ripping; beets files the result). Streaming: beets is a librarian, not a server — chapter 11 points at the servers in this series that can stream the library beets organises. And repairing bad audio: a scratched, clipping file stays scratched; beets only ever touches tags and filenames.
How to use this guide
Read chapter 1 for the model and
chapter 2 before installing anything —
knowing which part holds what (tags,
database, files) turns most later
confusion into a named problem.
Chapters 3 and 4 get you an import in
one sitting. Chapter 6 is the one to
read slowly: the track-versus-album
distinction it teaches is the single
idea that explains most beets
surprises, including the ones this
guide's lab walked into on purpose.
The lab's transcripts live in
beets-lab/transcripts/; its fixture
generator is beets-lab/make-fixtures.sh
and its configs are beets-lab/config.yaml
and friends.
Part of the series
This guide is one of the For Mere Mortals guides: plain-language guides to the tools programmers and makers use.
Related guides:
- Navidrome for Mere Mortals
- Jellyfin for Mere Mortals
- Audiobookshelf for Mere Mortals
- ffmpeg for Mere Mortals
- Python for Mere Mortals
License
The writing in this guide is licensed under CC BY 4.0. Code examples and lab scripts are licensed under the MIT License.