{"id":28234,"library":"spotipy2","title":"Spotipy2","description":"The next generation Spotify Web API wrapper for Python. Current version 0.6.1, supports Python 3.7+. Active development with async support, dataclass types, and OAuth flows.","status":"active","version":"0.6.1","language":"python","source_language":"en","source_url":"https://github.com/CyanBook/spotipy2","tags":["spotify","api","wrapper","async","web-api"],"install":[{"cmd":"pip install spotipy2","lang":"bash","label":"Install using pip"}],"dependencies":[{"reason":"HTTP client for async requests","package":"httpx","optional":false},{"reason":"Data validation and settings","package":"pydantic","optional":false}],"imports":[{"note":"Spotify is exported from the top-level package, not client module.","wrong":"from spotipy2.client import Spotify","symbol":"Spotify","correct":"from spotipy2 import Spotify"},{"note":"Authentication classes are in spotipy2.auth module.","wrong":"from spotipy2 import ClientCredentialsFlow","symbol":"ClientCredentialsFlow","correct":"from spotipy2.auth import ClientCredentialsFlow"},{"note":"Types are in spotipy2.types, not top-level.","wrong":"from spotipy2 import Track","symbol":"Track","correct":"from spotipy2.types import Track"}],"quickstart":{"code":"import os\nfrom spotipy2 import Spotify\nfrom spotipy2.auth import ClientCredentialsFlow\n\nclient_id = os.environ.get('SPOTIFY_CLIENT_ID', '')\nclient_secret = os.environ.get('SPOTIFY_CLIENT_SECRET', '')\n\nauth = ClientCredentialsFlow(client_id=client_id, client_secret=client_secret)\nclient = Spotify(auth)\n\ntrack = client.get_track('4cOdK2wGLETKBW3PvgPWqT')\nprint(track.name)","lang":"python","description":"Authenticate using Client Credentials Flow and fetch a track."},"warnings":[{"fix":"Check for None on fields like track.album when accessing nested data.","message":"In v0.6 simplified types were removed; all types now have optional fields defaulting to None.","severity":"gotcha","affected_versions":">=0.6"},{"fix":"Remove await when calling Type.from_dict; it now returns directly.","message":"In v0.3 Type.from_dict became synchronous. Async code expecting await will break.","severity":"breaking","affected_versions":">=0.3"},{"fix":"Ensure pymongo is installed and a MongoDB instance is running. Pass cache=... to Spotify constructor.","message":"Caching with MongoDB is only available if MongoDB is installed and configured; it's not built-in.","severity":"gotcha","affected_versions":">=0.5"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use: from spotipy2 import Spotify","cause":"Incorrect import path for Spotify client.","error":"ImportError: cannot import name 'Spotify' from 'spotipy2.client'"},{"fix":"Use dataclasses.asdict(track) or access track.__dict__ before serializing.","cause":"Trying to json.dumps a spotipy2 type directly.","error":"TypeError: Object of type Track is not JSON serializable"},{"fix":"Check that SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET environment variables are set correctly.","cause":"Invalid or missing credentials.","error":"spotipy2.exceptions.SpotifyException: 401 - Unauthorized"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}