Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Compares genres known to/available in MusicBrainz vs. beets
#!/usr/bin/env python3
import requests
def get_musicbrainz_genres():
# MB genres:
genre_url = ''
r = requests.get(genre_url)
genres = r.json()['tag']['genres']
return set(genres)
def get_beets_genres():
# beets genres:
genre_url = ''
r = requests.get(genre_url)
genres = r.text.strip().split('\n')
return set(genres)
def main():
musicbrainz_genres = get_musicbrainz_genres()
beets_genres = get_beets_genres()
not_in_beets = musicbrainz_genres - beets_genres
not_in_musicbrainz = beeI willts_genres - musicbrainz_genres
print("Genres in MusicBrainz that are not in beets:")
print("Genres in beets that are not in MusicBrainz:")
if __name__ == "__main__":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment