February 2018
Intermediate to advanced
456 pages
9h 56m
English
Before implementing the reader, we are going to add an enumeration to represent both kinds of authentication flow that Spotify provides us with. Let's go ahead and create a file called auth_method.py in the musicterminal/pytify/auth directory with the following content:
from enum import Enum, autoclass AuthMethod(Enum): CLIENT_CREDENTIALS = auto() AUTHORIZATION_CODE = auto()
This will define an enumeration with the CLIENT_CREDENTIALS and AUTHORIZATION_CODE properties. Now. we can use these values in the configuration file. Another thing we need to do is create a file called __init__.py in the musicterminal/pytify/auth directory and import the enumeration that we just created:
from .auth_method import ...