Files
predictify/README.md
T
Dominik ff9d726b47 Feat/import gdrp data (#26)
* Some simple code for extracting data from the jsons

* Jupiter Notebook

* Mac specific gitignore

* Fixed finding paths to floders

* Delete src/gdpr_data directory

* Updated gitignore to include my testing file

* Added the standard saving path for the database in the database handler, this way multiple files dont have to be updated when moving database position

* Moved the API usage wrappers into an own file, added a function for getting multiple track_ids at once, this still needs to be tested more

* Further code for extracting data from the gdpr files

* Forgor

* Final&Tested version of get_multiple_tracks_information endpoint

* Further functionality: The code now extracts the id of each listened song and makes a api call to get info about these songs via the multiple tracks api. Furthermore we track the songs witch the call is made for already and skip these

* Added function to map catalouged ids into the play history

* Added args parser to runtime program, cleaned up some code

* Fixed a bug where the database would always try to create tables, eaven if it exists

* Added some small text for clean interface

* Some final fixes to actual code, fixed db bug, reversed the order of database entries

* Some documentation

* Added -export args to docker runtime

* fix
2025-03-23 18:48:57 +01:00

58 lines
2.1 KiB
Markdown

# Predictify
## Overview
A Data analysis tool to scrape your Spotify History usage and let a ML-Model predict your next songs
## Authentication API
[Official Documentation](https://developer.spotify.com/documentation/web-api/tutorials/getting-started)
[Authorization Code Flow](https://developer.spotify.com/documentation/web-api/tutorials/code-flow)
## Usable possible APIs
Recently Played Tracks: `/me/player/recently-played` [Official Spotify Documentation](https://developer.spotify.com/documentation/web-api/reference/get-recently-played)
Get Track: `/tracks/{id}` [Official Spotify Documentation](https://developer.spotify.com/documentation/web-api/reference/get-track)
Get Track's Audio Features _(Deprecated)_: `/audio-features/{id}` [Official Spotify Documentation](https://developer.spotify.com/documentation/web-api/reference/get-audio-features)
Get Track's Audio Analysis _(Deprecated)_: `/audio-analysis/{id}` [Official Spotify Documentation](https://developer.spotify.com/documentation/web-api/reference/get-audio-analysis)
Get Artist: `/artists/{id}` [Official Spotify Documentation](https://developer.spotify.com/documentation/web-api/reference/get-an-artist)
## Docker usage
`cd` inside the projects directory:
```sh
cd predictify
```
To run predictify inside a container, first make sure to build the image:
```sh
make dockerfile
```
Create a seperate data directory (e.g. `docker-data`):
```sh
mkdir docker-data
```
> [!NOTE]
> To detatch the container to run it in the background add the `--detach` directly after the `run` command.
Then run the following docker command, to run the container in the foreground:
```sh
docker run \
--name predictify \
--network=host \
--volume $(pwd)/data-docker:/app/predictify/data \
--volume $(pwd)/config:/app/predictify/config \
predictify:unstable
```
## GDPR Data
If you have gdpr data, create a folder: ```data/gdpr_data``` and add all .json files containing your play history into it. In order to extract it, run the script: ```python3 src/runtime.py --export```
## Authors
[Chris Kiriakou](https://github.com/ckiri)
[Dominik Agres](https://github.com/agresdominik)