Mindful Melodies: Your Musical Companion for Mental Well-being | Python, APIs and Streamlit
In this project, I have created a powerful tool, MindfulMelodies, where users can log in to their accounts and gain access to a unique resource designed to support their mental health through the positive influence of music.
Overview
User Experience:
To use MindfulMelodies, follow these simple steps:
1.Login: After you've logged into your account on MindfulMelodies, you gain access to the full suite of features tailored to your well-being.
2.Choose Your Mental Health Issue: On the user-friendly interface, select the mental health problem you're facing from the dropdown menu. Options include Anxiety, Depression, Insomnia, and OCD.
3.Discover Personalized Playlists: Once you've chosen your mental health concern, MindfulMelodies presents you with a carefully curated list of playlists designed to uplift and support you. These playlists are selected based on genres known to have positive effects on specific mental health conditions.
4.Explore & Listen:Explore the playlists and find the perfect soundtrack for a healthier and happier you. Each playlist is associated with a range of genres, allowing you to choose the one that resonates with you the most.
Connect to Spotify:With a simple button click, seamlessly connect to the Spotify playlist of your choice. Immerse yourself in the therapeutic power of music.
Code Snippet
Below is a snippet of the libraries used in the development of MindfulMelodies, along with brief explanations of why each library was included:
- pandas:Used for data manipulation and analysis, ensuring efficient handling of the dataset.
- matplotlib and seaborn: Employed for data visualization, aiding in the analysis and interpretation of correlations crucial to understanding the impact of variables on mental health.
- tkinter:Utilized for creating a graphical user interface, providing an interactive and user-friendly experience.
- requests:Facilitates interaction with external APIs, specifically the Spotify API for playlist integration.
- Spotipy:A Python library for the Spotify Web API, enabling seamless integration and retrieval of curated playlists.
- yaml:Used for configuration file handling, storing sensitive information securely. #log in credentials
- streamlit:Employs streamlit for creating interactive web applications with simple Python scripts, enhancing the overall user experience.
- wikipediaapi:Facilitates easy access to Wikipedia data, providing information on mental health conditions.
Data Cleaning and Analysis
MindfulMelodies underwent meticulous data cleaning and analysis, ensuring the dataset's integrity and extracting meaningful insights.
Data Cleaning:
- Removed null values and irrelevant data, enhancing the dataset's quality.
- Addressed outliers in columns such as Hours per day, BPM, and Age.
Data Visualization:
- Utilized matplotlib and seaborn to create:
- Correlation Heatmap: Revealing correlations between variables crucial to understanding their impact on mental health.
- Histograms: Providing a visual representation of the distribution of key variables.
- Barplots and Lineplots: Illustrating trends and patterns in the data.
Search Box from Wikipedia API
- Explore the definitions of each mental health condition or symptom in the tool, including Anxiety, Depression, Insomnia and OCD.
MindfulMelodies: Your musical companion on the journey to better mental well-being. Discover the profound impact of music on your mental health. Explore, listen, and find your perfect soundtrack for a healthier and happier you!
Streamlit script of presentation, also in the repository.