Skip to main content

beets-nohirescd

nohirescd prevents high-resolution source audio from being matched to a CD release during a beets album import. It can also audit a library for existing matches that violate the same rule and send those albums through beets' normal reimport workflow.

If any source track exceeds the configured maximum bit depth or sample rate, the plugin removes candidates whose matched medium is CD. It filters both the initial candidate list and candidates returned by manual searches or entered IDs.

Install

python -m pip install "beets-nohirescd @ git+https://github.com/treyturner/beets-plugins.git#subdirectory=plugins/nohirescd"

Configure beets

Enable the plugin:

plugins:
  - nohirescd

The defaults treat audio above 16-bit or 44.1 kHz as high resolution:

nohirescd:
  max_bitdepth: 16
  max_samplerate: 44100
  cd_media_pattern: '(?:^|[^A-Za-z0-9])(?:HDCD|HQCD|CD(?:-R)?)(?:$|[^A-Za-z0-9])'

The default media pattern matches values such as CD, Enhanced CD, 8cm CD, SHM-CD, HDCD, HQCD, and CD-R. It deliberately does not match SACD.

Import behavior

On album import tasks, every source item is checked. A single item above either configured limit activates filtering for the whole album.

Both album-level media and each mapped track's media are checked. This catches mixed-media releases, which beets may represent with the generic album-level value Media while retaining CD on individual mapped tracks.

After removing candidates, the plugin recalculates beets' recommendation. This prevents quiet mode from retaining a recommendation based on a removed CD candidate and produces no recommendation when no valid candidates remain.

Audit existing albums

Run the command without a query to audit every album in the library:

beet nohirescd

The concise console report contains one line per violating album followed by album and track totals. An existing album is a violation when any of its tracks exceeds either configured resolution limit and any of its tracks has stored media matching cd_media_pattern. These may be different tracks on a mixed-media release. Singleton items are not included.

Standard beets album queries restrict the audit:

beet nohirescd albumartist:"Beyoncé"

The audit reads metadata already stored in the beets library and does not query MusicBrainz.

CSV report

Use -o or --output to write a detailed UTF-8 CSV while retaining the concise console report:

beet nohirescd --output nohirescd-audit.csv

The output contains one row per violating album and overwrites an existing file at the specified path. Its columns are:

  • album_id, mb_albumid, albumartist, and album
  • path and track_count
  • max_bitdepth and max_samplerate
  • media, containing the album's distinct stored track media
  • hires_tracks and cd_tracks, containing semicolon-separated track details that show why the album was flagged

No report file is created unless --output is supplied.

Reimport violations

Use --reimport to pass the violating albums directly to beets' library reimport pipeline instead of producing an audit report:

beet nohirescd --reimport
beet nohirescd --reimport year:1990..1999

The command preserves the normal import configuration and prompts, except that it always runs this album-only audit's results through album import mode. Any configured singleton mode is restored when the command finishes. Because the nohirescd candidate filter must run during reimport, import.autotag must be enabled. Depending on the beets import configuration and choices made during the session, reimporting can update library metadata and files. --reimport cannot be combined with --output.

Development

uv sync
uv run pytest
uv run mypy
uv run pyright

Metadata

Release files for beets-nohirescd 0.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-nohirescd 0.1.1
File Size Uploaded Provenance Actions
beets_nohirescd-0.1.1.tar.gz 11.4 kB With provenance Details for beets_nohirescd-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for beets-nohirescd 0.1.1
File Interpreter ABI Platform Actions
beets_nohirescd-0.1.1-py3-none-any.whl Python 3 none any Details for beets_nohirescd-0.1.1-py3-none-any.whl

Total release size: 18.7 kB

Release files / beets_nohirescd-0.1.1.tar.gz

Download URL beets_nohirescd-0.1.1.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3a9fb9a64219311be85621b93e2aba781517aacd63815e25308293583ac32658
BLAKE2b-256 checksum
How to use checksums
2f577c05d0c2a273d26b053710e839c7ee9f39279418cfab6ed81ee57eb04668
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 Nov 22, 2026.

Transparency log

Release files / beets_nohirescd-0.1.1-py3-none-any.whl

Download URL beets_nohirescd-0.1.1-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7081f19ec823ea4f0ee17d2072026dac59aa3fee35369a61acffe562dcecac7
BLAKE2b-256 checksum
How to use checksums
273ef11104cdb4abc1307bc2f6bffa6f192631d48d394f6f51acb11abaa5f4b1
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 Nov 22, 2026.

Transparency log

Security for beets-nohirescd 0.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for beets_nohirescd-0.1.1.tar.gz

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 Nov 22, 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