import json with open('../src/app/groove_manifest_new.json', 'r') as infile: data = json.load(infile) genres = list(data.keys()) with open('genresFinalNow.json', 'w') as outfile: json.dump(genres, outfile) print("Genres extracted and saved to 'genresFinalNow.json' successfully.")