Coder Social home page Coder Social logo

sendcapital / spotipycollage Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 7.15 MB

Photo collage generator of your top artists and tracks from Spotify. Built with Flask, Spotipy and Pillow

Python 29.41% JavaScript 5.63% CSS 20.48% HTML 44.48%
spotipy spotipy-api spotipy-library

spotipycollage's Introduction

Spotify PhotoCollage Gen

Generates a photocollage of your top listened artists and tracks. Designed with this webpage color pallete.

Built with Flask, Spotipy and Pillow.

Screenshots

Setup

Libraries required

from dotenv import load_dotenv
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials, SpotifyOAuth
from flask import Flask, redirect, url_for, render_template, request, session, flash
from datetime import timedelta
import os
from PIL import Image, ImageDraw
import requests
from io import BytesIO
from random import shuffle
from flask_caching import Cache

Integrating with spotipy

To run the webpage, user authorization is required. Register your app at My Dashboard to get the credentials necessary to make autorized calls (a client id and client secret)

Your spotipy redirect uri can be http://example.com, http://localhost or http://127.0.0.1:9090. Whichever you'd prefer. For me, I could only use http://127.0.0.1:9090 for reasons that I can't be bothered to discover.

Loading environment variables

Use a .env file and python-dotenv to load your env variables into album.py

Making Changes

Every change made will be reflected in your terminal

 * Detected change in 'C:\\Users\\sendm\\Mooncake\\Kyoto\\albumCover\\album.py', reloading
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 336-424-228
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

To reflect the change to the webpage, refresh the page with ctrl + shift + r (Windows 10).

Going Further

Intended design

Actually intended to do a photo collage like this where the bigger cells would be assigned to your most listened artist but I couldn't understand how to implement it into my code and spotipy didn't have a function to grab number of times listened per artist, or at least I couldn't find it. Had a couple problems installing packages on windows too.

spotipycollage's People

Contributors

sendcapital avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.