Skip to main content

beets-cdman

This beets plugin lets you easily manage your collection of CDs. You can define CDs in your beets config and with CD definition files, and easily add, remove, or reorder folders.

cdman can't burn CDs, but this can be done by other software such as Brasero on GNOME, or K3b on KDE.

Install

Run this in your beets environment:

pip install beets-cdman

Setup your beets config:

plugins:
  ...
  - cdman

cdman:
  # Path to where you want your CDs to be stored.
  path: ~/Music/CDs  # optional, default ~/Music/CDs

  # The bitrate to use when populating MP3 CDs. This value is in kliobits.
  mp3_bitrate: 192  # optional, default 192

  # How audio CDs should be populated.
  #  - copy: Copy the file from your library to the CD directory
  #  - hard_link: Hard links the file from your library to the CD directory
  #  - soft_link: Soft links the file from your library to the CD directory
  #    - NOTE: Not all filesystems support this
  audio_populate_mode: copy  # optional, defaults to copy

  # How many threads to allocate. Unless you know what you're doing, you should leave this undefined.
  # threads: 12  # optional, default is your hardware thread count

  # This points to CD definitions made in external files
  # Don't use relative paths, as sometimes the system won't be able to find your definitions.
  # You can use `~` to indicate your home directory.
  cd_files:  # optional
    - /path/to/my/cd_file.yml
    - ./dont/use/relative/paths.yml

  # This defines CDs to populate with tracks
  cds:  # optional
    # This will create a CD directory in ~/Music/CDs/mp3-cd-name
    mp3-cd-name:
      # What type of CD this is.
      #  - mp3: An MP3 CD is defined by folders, and converts all tracks to MP3.
      #  - audio: The classic CD standard, simply plops files inside the folder.
      type: mp3

      # You can define the MP3 bitrate to use per-CD if you want.
      # This value overrides your config
      bitrate: 192  # optional, defaults to config

      folders:
        __root__:  # This is a special name that puts tracks inside of this folder directly into the CD folder instead.
          tracks:
            # Tracks can be defined with Beets queries or playlist files
            # There is no limit to the number of query or playlist fields, and they can be intermixed.
            - query: "'artist:Daft Punk'"
            - playlist: "/path/to/playlist_file.m3u"
        foals:
          # You can explicitly define your folder name here.
          # Leaving it undefined simply uses the key used to define this folder,
          # which is `foals` in this case.
          name: "Backwards Foals"  # optional, defaults to folder key
          tracks:
            # Track order matters! This will order the CD so that Part 2 plays before Part 1.
            - query: "'artist:Foals' 'album:Everything Not Saved Will Be Lost, Part 2'"
            - query: "'artist:Foals' 'album:Everything Not Saved Will Be Lost, Part 1'"

Note the use of double and single quotes. The double quotes are to ensure YAML doesn't get confused. The single quotes are to send singular expressions to beets. For example, "'artist:Daft Punk' 'album:Discovery'" would match all songs in the Discovery album and made by Daft Punk.

Usage

To create your CDs, simply run

beet cdman

This will look through your beets config for any CDs defined in there. If any are found, it will then create a folder in your path and place files inside the created folder.

You can also pass in paths to CD definition files, or directories containing CD definition files:

beet cdman daft-punk.yml rock.yml cd-definitions/

MP3 CDs

When cdman encounters an MP3 CD definition, it will create folders inside the CD folder and then convert all music files found from the configured tracks to an MP3. You can configure the bitrate of these MP3s with the mp3_bitrate config field, changing the bitrate field in the CD definition, or by passing --bitrate into the command.

For example, an MP3 CD definition that looks like this:

discoveries:
  type: mp3
  bitrate: 128
  folders:
    daft-punk:
      name: "Daft Punk"
      tracks:
        - query: "'artist:Daft Punk' 'album:Discovery'"
    Fantom87:
      tracks:
        - query: "'artist:Fantom87' 'album:Discovery'"

the-french-house:
  type: mp3
  bitrate: 256
  folders:
    Joshua:
      tracks:
        - query: "'artist:French79' 'album:Joshua'"
    Teenagers:
      tracks:
        - query: "'artist:French79' 'album:Teenagers'"

Would create a directory structure like this:

/path/to/cds_path:
    ├── discoveries
    │   ├── 01 Daft Punk
    │   │   ├── 01 One More Time.mp3
    │   │   ├── 02 Aerodynamic.mp3
    │   │   └── ...
    │   └── 02 Fantom87
    │       ├── 01 Pay Phone.mp3
    │       ├── 02 Oh, Dreamer.mp3
    │       └── ...
    └── the-french-house
        ├── 01 Joshua
        │   ├── 01 Remedy.mp3
        │   ├── 02 Hold On.mp3
        │   └── ...
        └── 02 Teenagers
            ├── 01 One for Wendy.mp3
            ├── 02 Burning Legend.mp3
            └── ...

Audio CDs

When cdman encounters an Audio CD definition, it will simply populate the CD folder with all music files found from the configured tracks. It can either copy, soft link, or hard link the files. You can configure this behavior with the audio_populate_mode config field, changing the populate_mode field in the CD definition, or by passing --populate-mode into the command.

For example, an Audio CD definition that looks like this:

not-saved-part-1:
  type: audio
  populate_mode: soft_link
  tracks:
    - query: "'artist:Foals' 'album:Everything Not Saved Will Be Lost, Part 1'"

not-saved-part-1:
  type: audio
  populate_mode: copy
  tracks:
    - query: "'artist:Foals' 'album:Everything Not Saved Will Be Lost, Part 2'"

Would create a directory structure like this:

/path/to/cds_path:
    ├── not-saved-part-1
    │   ├── 01 Moonlight.flac -> /path/to/Moonlight.flac
    │   ├── 02 Exits.flac -> /path/to/Exits.flac
    │   └── ...
    └── not-saved-part-2
        ├── 01 Red Desert.m4a
        ├── 02 The Runner.m4a
        └── ...

CD Definition Files

CD definition files let you define CDs in external files, to help keep your beets config file less cluttered. CD definition files follow the same format as the beets config cds field.

You can find an example CD definition file here

Credits

The music files used for testing are all created by Scott Buckley, and is protected under CC-BY 4.0.

Metadata

Release files for beets-cdman 1.1.1

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

Source distribution (sdist)

Source distribution for beets-cdman 1.1.1
File Size Uploaded Provenance
beets_cdman-1.1.1.tar.gz 31.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for beets-cdman 1.1.1
File Interpreter ABI Platform
beets_cdman-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 68.1 kB

Release files / beets_cdman-1.1.1.tar.gz

Download URL beets_cdman-1.1.1.tar.gz
Size 31.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1003808219afe36c436d810ea2502165e0f96d6a60b58d7d44eba319c3da417b
BLAKE2b-256 checksum
How to use checksums
f53f2b6aea6515a52c536d61ce8bfe24a02f6821bc5fdfa990237322e389b57a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.13.3 Linux/6.14.0-35-generic

Release files / beets_cdman-1.1.1-py3-none-any.whl

Download URL beets_cdman-1.1.1-py3-none-any.whl
Size 36.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
648f25d93ded5202cf6c2949cf6951dd77a7413d64dc1c7fc165ad43dc4d02c8
BLAKE2b-256 checksum
How to use checksums
5a3dc40566a89db4b8af092b30d12756cfd8e413c947cf4c7d06e9f26e3e7906
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.13.3 Linux/6.14.0-35-generic

Security for beets-cdman 1.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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