Weekly uses the Spotify API to pull your playing history and generates a weekly wrapped sent directly to your email. The system is implemented using Python, Airflow and Docker.
- Flask App : For authorizing weekly to access your spotify history
- Airflow : Run daily ETL jobs to load data to postgres and a weekly job to generate wrapped
ETL workflow for daily ingestion of data
Flow for generating wrapped and sending email
# initialize docker compose
docker-compose up airflow-init
docker-compose up
- Add connection entry in airflow for postgres
- Add API keys to Variable entries
- EMAIL_API_KEY - sendgrid
- REFRESH_TOKEN - spotify
- BEARER_TOKEN - spotify
- Run DAG’s from the UI at localhost:8080 , username : airflow password : airflow
- Set FLASK_APP=spotify-etl.py and create a env file with the following variables : CLIENT_ID and CLIENT_SECRET , refer to spotify documentation for details.