No description
Find a file
2024-02-22 13:14:46 +01:00
.vscode add packaging command 2023-11-14 13:30:44 +01:00
genres fix: update everynoise URL after it was turned into a static site 2024-02-22 13:14:46 +01:00
libs/rust chore: add cargo metadata 2023-11-15 18:16:35 +01:00
metadata chore: last update from everynoise 2024-01-01 12:47:56 +01:00
schema feat: add languages method, fixes to model 2023-11-15 18:10:12 +01:00
translations Translated using Weblate (German) 2023-12-12 00:46:56 +00:00
.editorconfig Initial commit 2023-10-16 23:46:55 +02:00
.env.example refactor metadata: add genre IDs and names from Spotify 2023-10-27 00:29:50 +02:00
.gitignore add packaging command 2023-11-14 13:30:44 +01:00
.pre-commit-config.yaml refactor metadata: add genre IDs and names from Spotify 2023-10-27 00:29:50 +02:00
.prettierrc reformatted 2023-10-19 13:34:32 +02:00
Cargo.toml feat: add Rust library 2023-11-14 22:22:59 +01:00
LICENSE add license and readme 2023-10-29 23:47:43 +01:00
README.md chore: update genres from Spotify 2023-12-02 01:07:26 +01:00
requirements.txt get genres from everynoise.com 2023-10-26 21:44:28 +02:00

Spotify Genrebase

This repository is an attempt to collect information about the currently 6271 genres on Spotify. This includes localized names, description texts, countries, languages and a simple hierarchical structure.

This project aims to provide the necessary data for the following use cases:

  • Display an artist's genres as served by the Spotify API using pretty, localized names
  • Display all genres as a tree for easy navigation
  • Show the user relevant genres depending on their configured locale
  • Flatten genres into a more simple structure for organization (e.g. symphonic melodic death metal -> metal)

Package format

Genre metadata

Path: genres.json

{
  "indie rock": {
    "parent": "rock",
    "language": "en",
    "country": "DE",
    "region": "DH",
    "rank": 91,
    "playlists": {
      "2018": "4hEtcsHM3c35tEuDzIpbPf",
      "2019": "7JdvwjoMsTgzdxSuEPQx2P",
      "2020": "3Zcsc2oJjZCKMTXdgyx8jh",
      "2021": "2vnNPYH27nCaClMbPYdJWg",
      "2022": "4IvGeVlcJB2ZcrTNtkpv8m",
      "2023": "0Rwl2tuvaiGbHTdQ5YxXHN",
      "edge": "1Xf43rER49rVtWjinjP5fw",
      "intro": "57LVDJMvyx5crhWfpFQfgJ",
      "pulse": "6zj2ZyaP4WLzE5AhilyeX0",
      "sound": "4XXr357Jej7eUBh7XPK8hb"
    },
    "metagenre": false,
    "deprecated": false
  }
}

Genre tree

Path: tree/tree.{lang}.json

[
  {
    "id": "singer-songwriter",
    "name": "Singer-Songwriter",
    "rank": 48,
    "playlists": {
      "sound": "6gD9fCYGxsT9A8t3BHDVuj"
    },
    "children": [
      {
        "id": "scottish singer-songwriter",
        "name": "Schottischer Singer-Songwriter",
        "country": "UK",
        "rank": 1117,
        "playlists": {
          "sound": "2r6lIp87MMXvjAfJRg7Rgo"
        }
      }
    ]
  }
]

Translations

Path: lang/{lang}.json

{
  "<ID>": "Name",
  "indie rock": "Indie rock"
}

Development

Update genre metadata

# Update genres from everynoise.com (updates everynoise_genres.json)
python genres/get_everynoise.py

# Write updated genres to metadata files
python genres/genres_to_meta.py genres2meta
npx prettier -w metadata/*

# Annotate new genres (add parent, country, language)

# Validate genre metadata
python genres/genres_to_meta.py validate

# Update _main translation
python genres/genres_to_meta.py maketl

# Scrape playlist IDs
python genres/genres_to_meta.py scrapePlaylists
python genres/genres_to_meta.py scrapePlaylistsYear --year 2023
npx prettier -w metadata/*

Create translation

python genres/genres_to_meta.py newtl --file translations/xy.json

Translation status

Translation status