A Python tool for automatically updating MP3 album tags based on folder names. The tool works recursively through subdirectories and provides colorful output with emojis for better user experience.
- 🎵 Automatic album tag updates based on folder names
- ⚡ Smart tag comparison - skips files where tags are already correct
- 🔄 Recursive processing of subdirectories
- 🎨 Colorful console output with meaningful emojis
- 🧹 Smart name cleaning (removes punctuation, normalizes whitespace)
- 📁 Multiple directories processing at once
- 🛡️ Robust error handling with detailed messages
- 🏷️ ID3 tag support with automatic tag creation
- Python 3.8 or higher
- Poetry (recommended) or pip
# Clone repository
git clone <repository-url>
cd mp3_tag_folders
# Install dependencies
poetry install
# Run the tool
poetry run mp3_tag_folders /path/to/music/folder# Install dependencies
pip install mutagen colorama
# Run script directly
python mp3_tag_folders.py /path/to/music/foldermp3_tag_folders <directory1> [<directory2> ...]# Process single directory
mp3_tag_folders /home/user/Music/Podcasts
# Process multiple directories at once
mp3_tag_folders /home/user/Music/Album1 /home/user/Music/Album2
# Process current directory
mp3_tag_folders .🔄 Processing directory: /home/user/Music/My Album
🎵 Updated album tag for song1.mp3 → 'My Album'
⏭️ Skipped song2.mp3 (album tag already correct: 'My Album')
🎵 Updated album tag for song3.mp3 → 'My Album'
✅ Album tagging for /home/user/Music/My Album/Bonus Tracks done.
🎵✨ All MP3 files in '/home/user/Music/My Album' and its subdirectories have been updated.
- Folder Analysis: The tool reads the folder name and cleans it by removing punctuation and normalizing whitespace
- MP3 Discovery: Finds all
.mp3files in the current directory (non-recursive for files) - Tag Comparison: Checks if the current album tag already matches the target value
- Smart Update: Only writes tags when changes are actually needed, improving performance
- Recursive Processing: Processes all subdirectories recursively
- Progress Reporting: Provides real-time feedback with colorful emoji indicators
The tool uses various emojis to indicate different states:
- 🔄 Processing: Currently working on a directory
- 🎵 Updated: Successfully updated an MP3 file's album tag
- ⏭️ Skipped: File skipped because album tag is already correct
- ✅ Complete: Finished processing a subdirectory
- ❌ Error: Failed to update a file or access a directory
- 🚫 Permission: Permission denied errors
- 📁❌ Not Found: Directory not found
- ℹ️ Info: Usage information
- 🎵✨ Final: All processing completed successfully
Music/
├── The Beatles - Abbey Road/
│ ├── 01 - Come Together.mp3
│ ├── 02 - Something.mp3
│ └── Bonus Tracks/
│ └── 03 - Her Majesty.mp3
└── Pink Floyd - Dark Side of the Moon/
├── 01 - Speak to Me.mp3
└── 02 - Breathe.mp3
After running mp3_tag_folders Music/:
- All files in "The Beatles - Abbey Road/" get album tag: "The Beatles Abbey Road"
- All files in "Bonus Tracks/" get album tag: "Bonus Tracks"
- All files in "Pink Floyd - Dark Side of the Moon/" get album tag: "Pink Floyd Dark Side of the Moon"
mp3_tag_folders --help # Show help message
mp3_tag_folders --version # Show version information
mp3_tag_folders <directories> # Process specified directoriesThis project is licensed under the terms specified in the LICENSE file.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
If you encounter any issues or have questions, please open an issue on the project repository.