Swiftie Song Database
- hlfwatson
- Jan 16, 2025
- 2 min read
Updated: Feb 8, 2025
I recently completed a project using Java and Python to explore Taylor Swift song lyrics from a dataset.
Objective: The objective of this project was to develop a script that could read song data from a text file, organize it into objects, and provide functionality for users to interact with data.
🔍 Key Features:
1. Data Parsing: Utilizing the file I/O capabilities of Java and Python to read the lyrics and song data from a txt file to be structured into objects.
2. Interactive Interface: Implemented a user-friendly interface allowing users to:
- View available songs and their lyrics.
- Search for songs containing specific keywords in their lyrics.
3. Error Handling: Implemented robust error handling mechanisms to prevent potential issues like missing data or incorrect input.
4. Java to Python: After finishing the initial iteration for the 1213 final lab, I converted the Java code into Python so there would be both versions.
👩💻 Tech Used: Python, Java, File I/O, BufferedReader, Overriding, Object-Oriented Programming (OOP)
💡 Key Takeaways: Throughout the project, I gained valuable experience in data parsing, user interface design, and error handling in multiple languages. It also reinforced my understanding of OOP principles and software design practices when accounting for user input.
⏭ Next Steps: I am eager to continue exploring the intersection of data analysis and software development. I will use my abilities in Java or Python to tackle more complex projects and solve real-world problems.
Below is an example of my output codes!
Feel free to check out the code on my GitHub repository [T.Swift Song Directory] and let me know your thoughts!
@hwatson13 ➜ /workspaces/hwatson13 (main) $ /home/codespace/.python/current/bin/python "/workspaces/hwatson13/T.Swift Song Directory/TSwift Directory.py"
Welcome to the Swift Song Database!
1. View avaiable songs and their lyrics
2. Search for songs containing a keyword in lyrics
3. Exit
Enter your choice: 1
Available songs:
1. Picture To Burn
2. Teardrops On My Guitar
3. A Place In This World
...
@hwatson13 ➜ /workspaces/hwatson13 (main) $ /home/codespace/.python/current/bin/python "/workspaces/hwatson13/T.Swift Song Directory/TSwift Directory.py"
Welcome to the Swift Song Database!
1. View avaiable songs and their lyrics
2. Search for songs containing a keyword in lyrics
3. Exit
Enter your choice: 2
Enter a keyword to search for in the lyrics index: pain
Songs containing 'pain':
Cold As You
I'm Only Me When I'm With You
The Best Day (Taylor's Version)
Sparks Fly (Taylor's Version)
Dear John (Taylor's Version)
Better Than Revenge (Taylor's Version)
Haunted (Taylor's Version)
When Emma Falls in Love (Taylor's Version) (From The Vault)
State Of Grace (Taylor's Version)
Everything Has Changed (Taylor's Version)
All Too Well (10 Minute Version) (Taylor's Version) (From The Vault)
Sweeter Than Fiction
Blank Space (Taylor’s Version)
I Did Something Bad
Dancing With Our Hands Tied
The Man
Miss Americana & The Heartbreak Prince
Paper Rings
Soon You'll Get Better
the 1
my tears ricochet
peace
coney island
ivy
closure
evermore
Midnight Rain
Question...?
Would've, Could've, Should've
You're Losing Me
loml
thanK you aIMee



Comments