Organize repository by moving all scripts to scripts/ folder

- Moved all Python processing scripts to scripts/ directory for better organization
- Preserves git history using git mv command
- Clean separation between main project files and utility scripts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Johan Lundberg 2025-07-01 00:36:08 +02:00
parent 462fdcfa84
commit 872fdfa0ee
15 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,269 @@
#!/usr/bin/env python3
"""
Extended script to add more album information to the Top 500 Albums CSV file.
This script contains additional album data that can be added to supplement the original update script.
"""
import csv
import shutil
from datetime import datetime
def create_extended_album_lookup():
"""
Create an extended lookup dictionary for more famous albums.
This supplements the original lookup dictionary with additional entries.
"""
return {
# Classic Rock
("Captain Beefheart & His Magic Band", "Trout Mask Replica"): (
"Straight, 1969",
"Captain Beefheart's avant-garde masterpiece is one of the most challenging and influential albums in rock history. Produced by Frank Zappa, the double album features 28 compositions that blend blues, free jazz, and experimental rock into a virtually unclassifiable whole. Don Van Vliet's distinctive growling vocals and the Magic Band's impossibly complex rhythms, developed through months of obsessive rehearsal, created a sound that influenced generations of experimental musicians. Despite its initial commercial failure and bewildering reception, the album is now recognized as a landmark of artistic innovation."
),
("Hüsker Dü", "Zen Arcade"): (
"SST, 1984",
"Hüsker Dü's ambitious double album concept piece about a boy running away from home established the Minneapolis trio as pioneers of alternative rock. The album's combination of hardcore punk energy with melodic sensibilities and complex song structures anticipated the alternative rock explosion of the 1990s. Songs like 'Chartered Trips' and 'Turn on the News' showcase Bob Mould's powerful songwriting and the band's ability to balance aggression with emotional depth. The album's influence on bands like Nirvana and the Pixies cannot be overstated."
),
("Ray Charles", "The Genius of Ray Charles"): (
"Atlantic, 1959",
"Ray Charles's breakthrough album established him as one of America's greatest musical innovators, blending gospel, blues, jazz, and pop into a revolutionary new sound. The album features definitive versions of 'Let the Good Times Roll' and 'Don't Let the Sun Catch You Cryin',' showcasing Charles's ability to inhabit any musical style completely. His emotional intensity and technical virtuosity, combined with sophisticated big band arrangements, created a template for soul music that influenced countless artists."
),
("Neil Young & Crazy Horse", "Everybody Knows This Is Nowhere"): (
"Reprise, 1969",
"Neil Young's second solo album and his first collaboration with Crazy Horse established the template for his long career of electric guitar exploration. The album's raw, garage rock energy on songs like 'Cinnamon Girl' and 'Down by the River' contrasted with his previous folk-oriented work. The 10-minute guitar workout 'Cowgirl in the Sand' showcased Young's ability to create transcendent music through repetition and feedback. The album's influence on grunge and alternative rock would become apparent decades later."
),
("Gram Parsons", "Grievous Angel"): (
"Reprise, 1974",
"Gram Parsons's final album, completed shortly before his death, is considered the masterpiece of country rock. Working with Emmylou Harris, whose harmonies elevate every song, Parsons created a deeply personal statement about love, loss, and redemption. Songs like 'Return of the Grievous Angel' and 'Hearts on Fire' showcase his ability to blend traditional country with rock sensibilities. The album's influence on alternative country and Americana music continues to this day."
),
("Talking Heads", "Fear of Music"): (
"Sire, 1979",
"Talking Heads' third album marked their evolution from art punk to a more sophisticated exploration of rhythm and texture. Produced by Brian Eno, the album's angular rhythms and David Byrne's neurotic vocals on songs like 'Life During Wartime' and 'Cities' created a paranoid urban sound that captured the anxiety of late-1970s America. The album's influence on post-punk and new wave was immediate and lasting."
),
("Public Image Ltd.", "Metal Box"): (
"Virgin, 1979",
"John Lydon's post-Sex Pistols project created one of the most innovative albums in rock history with this collection of dub-influenced post-punk. The album's heavy bass lines, courtesy of Jah Wobble, and Keith Levene's jagged guitar work created a sound that was both futuristic and primal. Originally released in a metal film canister, songs like 'Albatross' and 'Swan Lake' showcase the band's ability to deconstruct and rebuild rock music from the ground up."
),
("Love", "Da Capo"): (
"Elektra, 1966",
"Love's second album is a masterpiece of psychedelic folk rock that showcased Arthur Lee's sophisticated songwriting and the band's dynamic range. The album's first side features perfectly crafted pop songs like '7 and 7 Is' and 'She Comes in Colors,' while the second side is dominated by the 19-minute experimental piece 'Revelation.' The band's ability to balance accessibility with experimentation made them one of the most important but underrated bands of the 1960s."
),
("X", "Wild Gift"): (
"Slash, 1981",
"X's second album perfected their unique blend of punk rock and rockabilly, creating one of the definitive albums of the Los Angeles punk scene. The husband-and-wife vocals of John Doe and Exene Cervenka, combined with Billy Zoom's razor-sharp guitar work, created a sound that was both primitive and sophisticated. Songs like 'White Girl' and 'We're Desperate' showcase their ability to create punk anthems with literary depth."
),
("Paul McCartney & Wings", "Band on the Run"): (
"Apple, 1973",
"Paul McCartney's post-Beatles masterpiece was recorded under difficult circumstances in Lagos, Nigeria, but resulted in his most cohesive and acclaimed solo work. The album's title track suite and songs like 'Jet' and 'Helen Wheels' showcase McCartney's gift for melody and his ability to create sophisticated pop music. The album's success proved that McCartney could thrive outside the Beatles and established Wings as a legitimate rock band."
),
("Pere Ubu", "The Modern Dance"): (
"Blank, 1978",
"Pere Ubu's debut album established them as pioneers of industrial rock and post-punk, combining avant-garde sensibilities with rock energy. David Thomas's theatrical vocals and the band's use of synthesizers and tape manipulation created a sound that was both unsettling and compelling. Songs like 'Non-Alignment Pact' and the title track showcase their ability to create art rock that maintained punk's confrontational spirit."
),
# Electronic/Ambient
("The Orb", "The Orb's Adventures Beyond the Ultraworld"): (
"Big Life, 1991",
"The Orb's debut album established them as pioneers of ambient house music, creating hour-long compositions that blend electronic beats with found sounds and field recordings. Alex Paterson and Thrash's use of samples from science fiction films and nature recordings created a dreamy, psychedelic form of dance music. The album's influence on chillout and ambient electronic music was immediate and lasting."
),
("Flying Lotus", "Cosmogramma"): (
"Warp, 2010",
"Steven Ellison's third album as Flying Lotus is a genre-defying exploration of electronic music, jazz, and hip-hop that established him as one of the most innovative producers of the 2010s. The album's complex rhythms and dense layering, featuring contributions from Thom Yorke and Thundercat, created a new form of experimental hip-hop. Songs like 'Do the Astral Plane' showcase his ability to create both cerebral and visceral electronic music."
),
# Alternative/Indie Rock
("The Flaming Lips", "The Soft Bulletin"): (
"Warner Bros., 1999",
"The Flaming Lips' ninth studio album marked their evolution from noisy alternative rock to orchestral psychedelic pop. Wayne Coyne's childlike vocals and the band's lush arrangements on songs like 'Race for the Prize' and 'Waiting for a Superman' created a sound that was both epic and intimate. The album's themes of mortality and hope, combined with its innovative production, established the Flaming Lips as one of alternative rock's most unique voices."
),
("Guided by Voices", "Bee Thousand"): (
"Scat, 1994",
"Robert Pollard's lo-fi masterpiece contains 20 songs in 35 minutes, showcasing his gift for melody and his DIY aesthetic. Recorded on a four-track in Pollard's basement, the album's deliberately rough production and fragmented song structures created a new template for indie rock. Songs like 'I Am a Scientist' and 'Tractor Rape Chain' demonstrate Pollard's ability to create memorable pop songs within an experimental framework."
),
("The Jesus and Mary Chain", "Psychocandy"): (
"Blanco y Negro, 1985",
"The Reid brothers' debut album combined pop melodies with walls of feedback and distortion, creating a sound that influenced generations of alternative rock bands. The album's 14 songs blur the line between beauty and noise, with tracks like 'Just Like Honey' and 'Never Understand' showcasing their ability to create accessible songs within a harsh sonic landscape. The album's influence on shoegaze and alternative rock was immediate and lasting."
),
("Dinosaur Jr.", "You're Living All Over Me"): (
"SST, 1987",
"J. Mascis's guitar heroics and the band's combination of punk energy with classic rock influences created one of the most influential albums of the 1980s alternative rock scene. The album's loud-quiet-loud dynamics and Mascis's distinctive guitar sound on songs like 'Freak Scene' and 'Sludgefest' anticipated the grunge explosion of the early 1990s. The band's influence on alternative rock cannot be overstated."
),
("Mazzy Star", "So Tonight That I Might See"): (
"Capitol, 1993",
"Hope Sandoval's dreamy vocals and David Roback's atmospheric guitar work created one of the most beautiful albums of the 1990s alternative rock scene. The album's languid pace and psychedelic textures on songs like 'Fade Into You' and 'Blue Flower' created a sound that was both nostalgic and timeless. The album's influence on dream pop and shoegaze continues to this day."
),
# Hip-Hop
("EPMD", "Strictly Business"): (
"Priority, 1988",
"Erick Sermon and Parrish Smith's debut album established them as masters of sample-based hip-hop production. The album's laid-back grooves and clever wordplay on songs like the title track and 'You Gots to Chill' created a more relaxed alternative to the aggressive hip-hop of the late 1980s. Their influence on hip-hop production and their role in launching careers of future stars make this album a classic."
),
("Young Thug", "Barter 6"): (
"300 Entertainment, 2015",
"Young Thug's commercial mixtape debut showcased his unique vocal style and melodic approach to trap music. The album's innovative production and Thug's genre-blending approach on songs like 'Check' and 'With That' established him as one of hip-hop's most influential voices. His impact on contemporary rap and his role in popularizing melodic trap cannot be overstated."
),
# Classic Jazz/Blues
("Ornette Coleman", "Free Jazz"): (
"Atlantic, 1961",
"Ornette Coleman's revolutionary album featured two simultaneous quartets improvising freely, creating one of the most challenging and influential albums in jazz history. The 37-minute continuous performance broke down traditional jazz structures and established Coleman as a leader of the free jazz movement. The album's influence on experimental music extends far beyond jazz."
),
# Reggae
("King Tubby", "Meets Rockers Uptown"): (
"Yard, 1976",
"King Tubby's collaboration with Augustus Pablo established the template for dub reggae, using the mixing board as an instrument to create spacious, echo-laden soundscapes. The album's innovative use of reverb, delay, and instrumental isolation techniques created a new form of electronic music that influenced everything from post-punk to electronic dance music."
),
("The Congos", "Heart of the Congos"): (
"Black Ark, 1977",
"Produced by Lee 'Scratch' Perry at his legendary Black Ark studio, this album is considered one of the greatest achievements in reggae music. Cedric Myton's falsetto vocals and the trio's spiritual harmonies, combined with Perry's innovative production, created a deeply mystical form of roots reggae. The album's influence on roots reggae and its spiritual themes make it essential listening."
),
# More Modern Entries
("Tame Impala", "Lonerism"): (
"Modular/Interscope, 2012",
"Kevin Parker's second album as Tame Impala perfected his psychedelic pop sound, combining 1960s influences with modern production techniques. The album's lush soundscapes and introspective lyrics on songs like 'Elephant' and 'Feels Like We Only Go Backwards' created a modern psychedelic classic. The album's influence on contemporary indie rock and electronic music has been enormous."
),
("Big Thief", "U.F.O.F."): (
"4AD, 2019",
"Adrianne Lenker's intimate songwriting and the band's delicate arrangements created one of the most beautiful indie folk albums of the 2010s. The album's sparse production and Lenker's whispered vocals on songs like 'Not' and 'Simulation Swarm' showcase the band's ability to create profound emotional impact through understatement."
),
("The Mountain Goats", "The Sunset Tree"): (
"4AD, 2005",
"John Darnielle's autobiographical album about growing up with an abusive stepfather is a masterpiece of indie folk songwriting. The album's sparse arrangements and Darnielle's literary lyrics on songs like 'This Year' and 'Dance Music' create a powerful emotional journey. The album's influence on indie folk and its unflinching honesty about family trauma make it essential listening."
),
# Electronic/Experimental
("Talk Talk", "Laughing Stock"): (
"Verve, 1991",
"Talk Talk's final album pushed their sound to its most experimental extreme, creating a form of post-rock that influenced countless bands. Mark Hollis's whispered vocals and the band's use of silence and space created music that was both challenging and beautiful. The album's influence on post-rock and experimental music continues to grow."
),
("Throbbing Gristle", "20 Jazz Funk Greats"): (
"Industrial, 1979",
"Despite its misleading title and sunny cover photo, Throbbing Gristle's third album is a dark exploration of industrial music that helped establish the genre. The band's use of synthesizers, tape manipulation, and found sounds created a sound that was both futuristic and disturbing. The album's influence on industrial music and electronic music in general cannot be overstated."
),
# More Hip-Hop/R&B
("Missy Elliott", "Supa Dupa Fly"): (
"The Goldmind/East West, 1997",
"Missy Elliott's debut album, produced largely by Timbaland, established her as one of hip-hop's most innovative artists. The album's futuristic production and Elliott's creative wordplay on songs like 'The Rain (Supa Dupa Fly)' and 'Sock It 2 Me' created a new form of hip-hop that was both experimental and accessible. The album's influence on hip-hop production and female rap cannot be overstated."
),
("Janelle Monáe", "The ArchAndroid"): (
"Wondaland/Bad Boy, 2010",
"Janelle Monáe's debut full-length album is a ambitious concept album that blends funk, soul, rock, and electronic music into a cohesive science fiction narrative. The album's complex arrangements and Monáe's powerful vocals on songs like 'Tightrope' and 'Cold War' showcase her ability to create both accessible pop and experimental art. The album established Monáe as one of the most creative voices in contemporary R&B."
),
}
def read_csv_file(filepath):
"""Read the CSV file and return the data."""
with open(filepath, 'r', encoding='utf-8') as f:
reader = csv.DictReader(f)
return list(reader)
def identify_missing_albums(data):
"""Identify albums with missing Info and Description."""
missing_albums = []
for row in data:
if not row.get('Info', '').strip() and not row.get('Description', '').strip():
missing_albums.append(row)
return missing_albums
def update_album_info(data, lookup_dict):
"""Update albums with information from the lookup dictionary."""
updated_count = 0
for row in data:
# Check if this album needs updating
if not row.get('Info', '').strip() and not row.get('Description', '').strip():
# Try to find it in our lookup dictionary
key = (row['Artist'], row['Album'])
if key in lookup_dict:
info, description = lookup_dict[key]
row['Info'] = info
row['Description'] = description
updated_count += 1
print(f"Updated: {row['Artist']} - {row['Album']}")
return updated_count
def write_csv_file(filepath, data, fieldnames):
"""Write the updated data back to CSV file."""
with open(filepath, 'w', newline='', encoding='utf-8') as f:
writer = csv.DictWriter(f, fieldnames=fieldnames)
writer.writeheader()
writer.writerows(data)
def main():
"""Main function to run the extended update process."""
csv_file = '/home/lundberg/projects/top500albums/top_500_albums_2023.csv'
backup_file = f'/home/lundberg/projects/top500albums/top_500_albums_2023_backup_extended_{datetime.now().strftime("%Y%m%d_%H%M%S")}.csv'
print(f"Reading CSV file: {csv_file}")
# Read the original data
data = read_csv_file(csv_file)
total_albums = len(data)
print(f"Total albums in database: {total_albums}")
# Identify albums with missing information
missing_albums = identify_missing_albums(data)
print(f"Albums with missing Info/Description: {len(missing_albums)}")
if len(missing_albums) == 0:
print("No albums need updating!")
return
# Create backup
print(f"Creating backup: {backup_file}")
shutil.copy2(csv_file, backup_file)
# Create lookup dictionary
lookup_dict = create_extended_album_lookup()
print(f"Extended lookup dictionary contains {len(lookup_dict)} albums")
# Update the data
print("\nUpdating albums...")
updated_count = update_album_info(data, lookup_dict)
# Write the updated data back to file
if updated_count > 0:
fieldnames = ['Rank', 'Artist', 'Album', 'Status', 'Info', 'Description']
write_csv_file(csv_file, data, fieldnames)
print(f"\nSuccessfully updated {updated_count} additional albums!")
print(f"Updated file saved as: {csv_file}")
print(f"Backup saved as: {backup_file}")
else:
print("\nNo additional albums were updated.")
# Show remaining missing albums
remaining_missing = identify_missing_albums(data)
print(f"\nRemaining albums with missing info: {len(remaining_missing)}")
if remaining_missing:
print("\nFirst 20 albums still missing information:")
for i, album in enumerate(remaining_missing[:20]):
print(f"{album['Rank']}. {album['Artist']} - {album['Album']}")
if __name__ == "__main__":
main()