A collection of scripts to organize music files for DJ software like Rekordbox. Includes MusicBrainz API integration for accurate genre tagging.
# Install Homebrew dependencies
brew install ffmpeg
# Install Python dependencies
pip3 install mutagen musicbrainzngs-
Clean junk files (macOS metadata)
find /path/to/music -name "._*" -type f -delete -
Scan and tag with MusicBrainz (recommended)
python3 enrich_tags.py
Edit
base_dirin script to point to your music folder. -
Re-sort by embedded genre tags
python3 resort_by_tags.py
Edit
source_baseanddest_basein script. -
Import to Rekordbox
- File → Import → Folder
- Select the organized folder
- Genre tags will populate automatically
| Script | Purpose | Language |
|---|---|---|
enrich_tags.py |
Query MusicBrainz API and write genre/year tags | Python |
resort_by_tags.py |
Organize files by embedded genre tags | Python |
organize_music.sh |
Organize by Artist/Album structure | Bash |
organize_by_genre.sh |
Organize by manual genre mapping | Bash |
After running resort_by_tags.py:
Music_Tagged/
├── Hip-Hop/
│ ├── Kendrick Lamar/
│ ├── Slum Village/
│ └── ...
├── R&B/
│ ├── SZA/
│ ├── Baby Rose/
│ └── ...
├── House/
│ ├── Deep House/
│ │ ├── Theo Parrish/
│ │ ├── Moodymann/
│ │ └── ...
│ ├── Joy Orbison/
│ └── ...
└── _Unsorted/
└── (files without genre tags)
hip hop, rap, trap, grime, boom bap, conscious hip hop, gangsta rap, southern hip hop, underground hip hop, alternative hip hop, jazz rap
r&b, rhythm and blues, soul, neo-soul, funk, quiet storm, new jack swing, motown
deep house, soulful house, afro house, amapiano, jazzy house, garage house, broken beat, nu jazz, acid jazz, detroit techno
house, techno, electronic, dance, tech house, progressive house, uk funky, uk bass, drum and bass, jungle, breakbeat
- Rate limited to 1 request/second
- ~180 files takes ~4-5 minutes
- South African house artists have limited coverage
- Files without matches go to
_Unsorted
- MP3 (.mp3)
- FLAC (.flac)
- M4A (.m4a)
- AIFF (.aiff, .aif)
- WAV (.wav) - limited tag support
- Import the
_Taggedfolder after organization - Use Rekordbox's intelligent playlists to filter by genre
- Run analysis after import for BPM/key detection
- Genre tags sync to USB exports for CDJs