This tool is part of data-analysis series published on medium. Check it out (here)
..and create your own music dataset in few steps.
python getScrobbles.py -u 'Your last.fm username' -k 'Your api key'
...
python getUris.py -sk 'Your spotify key' -ss 'Your spotify secret'
And..
python getAudioFeatures.py -sk 'Your spotify key' -ss 'Your spotify secret'
That's all!
Now your own music dataset is ready for some appealing analysis.
This project is tested with Python 3.6 and more.
Git clone the project
Get the python dependecies
pip install -r requirements.txt
Create data directory
python prepare_directory.py
python getScrobbles.py -u 'Your last.fm username' -k 'Your api key'
This script collects all last.fm data saved to .csv format in the /folder_name/data folder.
More information about used api-endpoint ( here)
| Parameters | Description |
|---|---|
| Username -u (required) | The first parameter should be last.fm username. |
| Api Key -k (required) | In order to get last.fm data api key is required. You can easily get your own (here) |
python getUris.py -sk 'Your spotify key' -ss 'Your spotify secret'
This script collects all spotify uris and saved them to .csv format in the /folder_name/data folder.
In order to retrieve uris data we need spotify help.
Get your own spotify credentials ( here). We will use its spotify-key and spotify-secret as parameters.
| Parameters | Description |
|---|---|
| Spotify key -sk (required) | self-explenatory |
| Spotify secret -ss (required) | self-explenatory |
python getAudioFeatures.py -sk 'Your spotify key' -ss 'Your spotify secret'
This script creates audio features of each track based on uris.csv file.
| Parameters | Description |
|---|---|
| Spotify key -sk (required) | self-explanatory |
| Spotify secret -ss (required) | self-explanatory |