music-genie
Search YouTube for music, identify songs from mic recordings, and download them as tagged MP3s.
Invoked as mg or music-genie.
Installation
Requires Python 3.11+ and uv.
uv tool install music-genie # from PyPI
uv tool install . # local dev
Recording also requires a system ffmpeg (the bundled download binary cannot access audio devices):
sudo apt install ffmpeg # Debian/Ubuntu
brew install ffmpeg # macOS
sudo dnf install ffmpeg # Fedora
Usage
Search and download by query:
mg search "tame impala let it happen"
Presents up to 10 YouTube results, prompts for a selection, downloads as MP3, and embeds metadata (artist, album, year, cover art) sourced from MusicBrainz.
Identify a song from the microphone:
mg listen
Records an 8-second snippet, identifies it via Shazam, then flows into search and download. Pass --save to queue the snippet for later identification instead.
List unidentified snippets:
mg pending
Process queued snippets:
mg process
Attempts to identify each pending snippet and prompts to search and download. Unidentifiable snippets can be deleted.
Tag existing MP3 files:
mg tag ~/Music
Scans a folder for MP3 files and enriches them with metadata (artist, album, year, cover art, lyrics) sourced from MusicBrainz and LRCLib. Pass --skip-tagged to skip files that already have complete tags, or --force to overwrite existing tags.
Output layout
Files are saved to ~/Music/<artist>/<title>.mp3 by default.
Configuration
Settings can be overridden via environment variables or a TOML file at ~/.config/music-genie/config.toml.
| Key | Default | Description |
|---|---|---|
output_dir |
~/Music |
Download destination |
audio_format |
mp3 |
Output format (mp3, m4a, opus, …) |
audio_quality |
192 |
Bitrate in kbps |
record_duration |
8 |
Snippet length in seconds |
Environment variables use the prefix MUSIC_GENIE_, e.g. MUSIC_GENIE_OUTPUT_DIR=/tmp/music.
Example config file:
output_dir = "/home/user/Music"
audio_format = "mp3"
audio_quality = 320
record_duration = 10
Data storage
Snippets and their metadata are stored in ~/.local/share/music-genie/snippets/ as .wav + .json pairs.
🤖 AI Disclaimer
This project uses AI-assisted development tools. See the AI usage policy for details.
Tools
- Claude Code (Anthropic) ·
claude-sonnet-4-6· Agentic
Contribution Profile
Phase Human│ AI
─────────────────────────────────────────┼───────────────
Requirements & Scope 85% ████████│░░ 15%
Architecture & Design 50% █████│░░░░░ 50%
Implementation 5% │░░░░░░░░░░ 95%
Testing n/a
Documentation 5% │░░░░░░░░░░ 95%
Oversight: Autonomous
AI drives end-to-end; human reviews final output only.
Process
AI agent operated autonomously across multi-step tasks. Human reviewed diffs, resolved conflicts, and approved merges.
Accountability
The human author(s) are solely responsible for the content, accuracy, and fitness-for-purpose of this project.
Last updated: 2026-02-20 · Generated with ai-disclaimer
Metadata
Release files for music-genie 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| music_genie-0.4.0.tar.gz | 15.1 kB | Without provenance | Details for music_genie-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| music_genie-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for music_genie-0.4.0-py3-none-any.whl |
Total release size: 36.6 kB
Release files / music_genie-0.4.0.tar.gz
| Download URL | music_genie-0.4.0.tar.gz |
|---|---|
| Size | 15.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5bde9b74b7e4b0994ec64f431dccd7c709efd699a904935b2afe9446be32e47a
|
|
BLAKE2b-256 checksum How to use checksums |
cb20d05db3933faedf1c82676099c1db377759d041900b8f69bac6017fa1d71f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / music_genie-0.4.0-py3-none-any.whl
| Download URL | music_genie-0.4.0-py3-none-any.whl |
|---|---|
| Size | 21.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
908668807fe426b2dd54b66c216c88d8e441f9752a805e4d22c385478c015f77
|
|
BLAKE2b-256 checksum How to use checksums |
1e16fccb100080015bbdb877d118b73f010b6513765141b64d2e8db3cbfe780b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for music-genie 0.4.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.
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.