spotipy/examples/show_user.py
Stéphane Bruckert d0ca977647
Made cache_path and username optional (#567)
* Made cache_path and username optional

* Update readme and example

* Lint

* Lint

* Feedback / add warning
2020-08-30 23:59:38 +01:00

18 lines
405 B
Python

# Shows artist info for a URN or URL
from spotipy.oauth2 import SpotifyClientCredentials
import spotipy
import sys
import pprint
if len(sys.argv) > 1:
username = sys.argv[1]
else:
username = 'plamere'
client_credentials_manager = SpotifyClientCredentials()
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)
sp.trace = True
user = sp.user(username)
pprint.pprint(user)