Skip to main content

music-rename

日本語

Rename katakana artist names of non-Japanese artists in the macOS Music app (e.g. マドンナ → Madonna, エルトン・ジョン & キキ・ディー → Elton John & Kiki Dee) while leaving Japanese artists (スピッツ, ヨルシカ, ...) untouched.

  • Works without any account: English names come from the public iTunes Search API.
  • Optional Apple Music API (MusicKit) support if you are in the Apple Developer Program.
  • You review every change in a CSV first (can be turned off).
  • Every write is recorded first, and undo puts everything back.

Requirements

  • macOS with the Music app (tested on macOS 26)
  • Python 3.11+
  • On first run macOS asks whether your terminal may control Music. Allow it (System Settings → Privacy & Security → Automation).

Install

uv tool install music-rename          # or: pipx install music-rename
uv tool install 'music-rename[musickit]'   # with Apple Music API support

Usage

Keep the Music app open.

music-rename scan                     # list katakana names (no network)

music-rename plan -o plan.csv         # look up English names, write a CSV
#   edit plan.csv: set action to apply/skip, fix "proposed" if needed
music-rename apply plan.csv --dry-run # show what would change
music-rename apply plan.csv           # rename

music-rename undo ~/Library/Application\ Support/music-rename/backups/<file>.jsonl

Review on / off

review on (default) review off
Command plan → edit CSV → apply run --no-review (or review = false)
Foreign, high confidence apply apply
Foreign, medium / low confidence skip (decide in the CSV) apply
Looks Japanese skip skip

Even with review off a CSV record and a backup are written, so undo always works. Try review on first: the Japanese/foreign guess is only a guess.

CSV columns

column meaning
action apply or skip — edit this
original current value in the library (do not edit)
proposed new value — edit if you prefer another spelling
confidence high / medium / low / none: how well the catalog artist's albums and songs match your library. A medium name is raised to high when one of your songs is credited to exactly the proposed English name in the catalog (iTunes source only; adds about 6 seconds per song checked)
origin jp / foreign / unknown and origin_reason: why
fields, track_count, sample_albums, catalog_url, note context for your review

How it decides

  1. Candidates: the katakana name is searched in the Japanese storefront with English localization (lang=en_us). Collaborations (A & B, A feat. B) are tried as a whole first (so サイモン&ガーファンクル → Simon & Garfunkel), then part by part.
  2. Confidence: album and song titles of the candidate are compared with what is in your library. high = at least 1 album or 2 songs match.
  3. Japanese or not: names with kanji/hiragana are Japanese. Otherwise MusicBrainz (country JP) and Japanese genres (J-Pop, Anime, ...) are used. Apple's catalog has no "country" field, so MusicKit does not improve this part.

Configuration

See config.example.toml. Copy it to ~/.config/music-rename/config.toml. Useful settings:

  • [exclude] artists: names you never want renamed
  • [overrides]: your own "カタカナ" = "English" dictionary (used before the APIs)

Apple Music API (optional)

  1. Create a MusicKit key in your Apple Developer account and download the .p8 file.
  2. Set [musickit] key_path, key_id, team_id (or the MUSIC_RENAME_MUSICKIT_* environment variables) and run with --source musickit.

The key stays on your machine; the developer token is generated in memory.

Notes and limits

  • Speed: the iTunes Search API allows about 20 calls per minute, so the first run takes about 6 seconds per name. Results are cached for 30 days.
  • iCloud Music Library: renamed Apple Music tracks kept their new names on the Mac and synced to iPhone in our tests, but Apple may change this behaviour.
  • Smart playlists that filter on an artist name will need to be updated by hand.
  • Only artist names are sent to the APIs, plus up to two song titles per medium name when confirming it by song (verify_titles = 0 turns that off). Nothing else from your library leaves your Mac.

Development

uv sync
uv run ruff check && uv run ruff format --check && uv run mypy && uv run pytest
MUSIC_RENAME_TEST_PID=<persistent id> uv run pytest -m music   # touches one real track
uv run python scripts/smoke_live.py                            # checks the live APIs

Releasing

Bump version in pyproject.toml, commit, then push a matching tag (git tag v0.1.0 && git push origin v0.1.0). The Release workflow tests, builds and publishes to PyPI via Trusted Publishing.

License

MIT

Metadata

Release files for music-rename 0.1.0

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

Source distribution (sdist)

Source distribution for music-rename 0.1.0
File Size Uploaded Provenance Actions
music_rename-0.1.0.tar.gz 31.4 kB With provenance Details for music_rename-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for music-rename 0.1.0
File Interpreter ABI Platform Actions
music_rename-0.1.0-py3-none-any.whl Python 3 none any Details for music_rename-0.1.0-py3-none-any.whl

Total release size: 70.0 kB

Release files / music_rename-0.1.0.tar.gz

Download URL music_rename-0.1.0.tar.gz
Size 31.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ceb63a9902a89b81aa63e47d636ea270735221130919edced737cf870bba4bc8
BLAKE2b-256 checksum
How to use checksums
3c14e2417e2cfd2c3089b964940edc2a2113928a255c28cbdef4052feed7cb97
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 28, 2026.

Transparency log

Release files / music_rename-0.1.0-py3-none-any.whl

Download URL music_rename-0.1.0-py3-none-any.whl
Size 38.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95991406010554b863ea19b914d44f12f393b45ad5adb3e13d9dd9ec1ca1c49d
BLAKE2b-256 checksum
How to use checksums
4b85ac024a6431839d890659e7d3d6d946dd05a90f281f28f14e8166d09b783c
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 28, 2026.

Transparency log

Security for music-rename 0.1.0

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 music_rename-0.1.0.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 28, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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