How beetbox/beets works
Beets is a music library manager and metadata organizer. The principal workflow is: a user invokes an import command, files become import tasks, autotagging proposes metadata, the user accepts or adjusts the result, and tagged files plus catalog records are stored. The catalog then supports querying and management commands. Plugins extend enrichment, analysis, artwork, transcoding, web access, and playback. Some plugin wiring is inferred from documented capabilities and filenames; sampled excerpts primarily confirm importing, querying, pipeline execution, and integrations.
Main entry points: library.py Library Service · session.py Import Session · tasks.py Import Tasks · stages.py Import Stages
Components 27
User Interface
- CLI Commands
beets/ui/commands/__init__.py - Import Prompts
beets/ui/commands/import_/session.py
Import Workflow
- Import Session
beets/importer/session.py - Import Stages
beets/importer/stages.py - Import Tasks
beets/importer/tasks.py - Pipeline Engine
beets/util/pipeline.py - Autotag Matching
beets/autotag/match.py
Library Catalog
- Media File Tags
beets/mediafile.py - Library Models
beets/library/models.py - Library Service
beets/library/library.py - Query Parser
beets/dbcore/queryparse.py - Query Engine
beets/dbcore/query.py - SQLite Library
beets/dbcore/db.py
Plugin Features
- Plugin System
beets/plugins.py - Metadata Plugins
beets/metadata_plugins.py - Art And Lyrics
beetsplug/fetchart.py - ReplayGain Analysis
beetsplug/replaygain.py - Audio Transcoding
beetsplug/convert.py - Library Checks
beetsplug/duplicates.py - Web Browser
beetsplug/web/__init__.py - MPD Playback
beetsplug/play.py
External Integrations
- Metadata Sources
beets/autotag/source.py
Other components
- Music User
- MusicBrainz
- Discogs
- Last.fm
- Music Files
Connections 29
- Music User → CLI Commands: invokes
- CLI Commands → Import Session: starts import
- Import Prompts → Import Stages: chooses action
- Import Session → Import Stages: builds stages
- Import Session → Pipeline Engine: runs pipeline
- Import Stages → Import Tasks: creates tasks
- Import Tasks → Music Files: reads files
- Import Stages → Autotag Matching: requests matches
- Autotag Matching → Metadata Sources: queries sources
- Metadata Sources → MusicBrainz: looks up metadata
- Metadata Sources → Discogs: looks up metadata
- Import Prompts → Autotag Matching: reviews matches
- Import Tasks → Media File Tags: updates tags
- Import Tasks → Library Models: stores items
- Library Models → Library Service: manages records
- Library Service → SQLite Library: reads and writes
- CLI Commands → Query Parser: parses queries
- Query Parser → Query Engine: builds queries
- Query Engine → Library Service: filters records
- Query Engine → SQLite Library: reads catalog
- Import Session → Plugin System: dispatches events
- Plugin System → Metadata Plugins: loads extensions
- Metadata Plugins → Last.fm: fetches genres
- Metadata Plugins → Art And Lyrics: enriches files
- ReplayGain Analysis → Music Files: analyzes audio
- Audio Transcoding → Music Files: transcodes audio
- Library Checks → Library Service: checks records
- Web Browser → Library Service: browses catalog
- MPD Playback → Music Files: plays audio