Skip to main content

beets-autogenre

A beets plugin to assign genres to all items within your music library.

Features

  • Gets genres from last.fm using the lastgenre plugin.
  • Favours track as last.fm genre source when track is a remix.
  • Fallback to estimating the genre using the xtractor plugin / Essentia.
  • Fixes the genre of (re)mixes by matching the genre tree against the track and album title.
  • Allows to specify the genre per item manually.

Dependencies

The following beets plugins and their dependencies must be installed:

Installation

python3 -m pip install beets-autogenre

Configuration

Enable the plugin and add a autogenre section to your beets config.yaml as follows:

plugins:
  - autogenre
  - lastgenre
  - xtractor

autogenre:
  pretend: false
  all: false
  force: false
  lastgenre: true
  xtractor: true
  from_title: true
  genre_rosamerica_strong: 0.8
  genre_electronic_strong: 0.8
  genre_electronic_prepend: 0.5
  genre_electronic_append: 0.45

lastgenre:
  auto: false
  prefer_specific: true
  source: album
  count: 4
  min_weight: 15
  canonical: /etc/beets/genre-tree.yaml
  whitelist: /etc/beets/genres.txt

xtractor:
  auto: no
  dry-run: no
  write: yes
  threads: 4
  force: no
  quiet: no
  keep_output: no
  keep_profiles: no
  output_path: /tmp/xtractor
  essentia_extractor: /usr/local/bin/essentia_streaming_extractor_music
  high_level_targets:
    genre_rosamerica_probability: # 0..1
      path: "highlevel.genre_rosamerica.probability"
      type: float
    genre_electronic:
      path: "highlevel.genre_electronic.value"
      type: string
    genre_electronic_probability: # 0..1
      path: "highlevel.genre_electronic.probability"
      type: float
    timbre: # "dark" or "bright"
      path: "highlevel.timbre.value"
      type: string
    tonal_atonal: # "tonal" or "atonal"
      path: "highlevel.tonal_atonal.value"
      type: string
    key_edma: # e.g. "C#"
      path: "tonal.key_edma.key"
      type: string
    key_edma_scale: # e.g. "minor"
      path: "tonal.key_edma.scale"
      type: string
  extractor_profile:
    highlevel:
      svm_models:
        - /var/lib/essentia/svm-models/beta5/danceability.history
        - /var/lib/essentia/svm-models/beta5/gender.history
        - /var/lib/essentia/svm-models/beta5/genre_rosamerica.history
        - /var/lib/essentia/svm-models/beta5/genre_electronic.history
        - /var/lib/essentia/svm-models/beta5/mood_acoustic.history
        - /var/lib/essentia/svm-models/beta5/mood_aggressive.history
        - /var/lib/essentia/svm-models/beta5/mood_electronic.history
        - /var/lib/essentia/svm-models/beta5/mood_happy.history
        - /var/lib/essentia/svm-models/beta5/mood_sad.history
        - /var/lib/essentia/svm-models/beta5/mood_party.history
        - /var/lib/essentia/svm-models/beta5/mood_relaxed.history
        - /var/lib/essentia/svm-models/beta5/moods_mirex.history
        - /var/lib/essentia/svm-models/beta5/voice_instrumental.history
        - /var/lib/essentia/svm-models/beta5/tonal_atonal.history
        - /var/lib/essentia/svm-models/beta5/timbre.history

For more information, see CLI.

Usage

Once the autogenre plugin is enabled within your beets configuration, you can detect and assign the genres for each track within your library as follows:

beet autogenre

CLI

Usage: beet autogenre [options]

Options:
  -h, --help          show this help message and exit
  --pretend           do not persist item changes but log them
  -f, --force         reevaluate genres for items with a matching genre_source
  -a, --all           overwrite genre if genre_source not specified
  --no-all            do not overwrite genre from unspecified source
  --lastgenre         use lastgenre plugin
  --no-lastgenre      do not use lastgenre plugin
  --xtractor          use xtractor plugin
  --no-xtractor       do not use xtractor plugin
  --from-title        derive genre from title
  --no-from-title     do not derive genre from title
  --parent-genres     add primary genre's parent genres
  --no-parent-genres  do not add primary genre's parent genres
  --genre=GENRE       specify the genre to assign to the selected items

Development

Run the unit tests (containerized):

make test

Run the e2e tests (containerized):

make test-e2e

To test your plugin changes manually, you can run a shell within a beets docker container as follows:

make beets-sh

A temporary beets library is written to ./data. It can be removed by calling make clean-data.

Metadata

Release files for beets-autogenre 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for beets-autogenre 0.8.1
File Interpreter ABI Platform Actions
beets_autogenre-0.8.1-py3-none-any.whl Python 3 none any Details for beets_autogenre-0.8.1-py3-none-any.whl

Release files / beets_autogenre-0.8.1-py3-none-any.whl

Download URL beets_autogenre-0.8.1-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06119e7d85320a85c7cbf525135cfdf665f062072d7b5b8fd44eb5758da3b062
BLAKE2b-256 checksum
How to use checksums
32f41a04a8d9a32b6ac96a60e08eddc354605f64103c3b967a03ea59ccaf4608
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for beets-autogenre 0.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

1 file in this release has been uploaded with provenance metadata.

Attestation for beets_autogenre-0.8.1-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page